Results 1 to 4 of 4

Thread: null tastic

  1. #1
    Join Date
    Jan 2005
    Posts
    20

    Unanswered: null tastic

    Aaargh!
    Using a query to count the number of records for a stock database.
    When there are no records the query just returns the headings of the columns. How do I get the query to return "0" for no records?

    Thanks for any help to this probably very simple problem!

    Cheers

    Dave

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    What did you try? Count(*) should return 0 if no records are present.

  3. #3
    Join Date
    Jan 2005
    Posts
    20
    Thanks,
    Sorry the quaestion was probably a bit vague
    The query looks at a table.
    The two fields are [Assigned?] and [AssignedTo?]. [AssignedTo?] is a true false. So I set the query up to look for false results. In the [Assigned?] I have used the Count on the Total row of the query.
    If I have no records I get nothing but the column headings, if I change [AssignedTo?] to true (look for true records) I get the number of true records. I may have set this up wrong to start with?
    I then grab this figure from another form, but I cannot pass the null value hence why i need a zero.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by davidcoombs100
    I then grab this figure from another form, but I cannot pass the null value hence why i need a zero.
    How do you grab it? Try NZ(Expression, 0) on the DLookup\ DCount or whatever you are using.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •