Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2002
    Location
    TX
    Posts
    34

    Unanswered: IIF statement in report footer

    I want to count the number of orders due for today at the end of a report. The report lists orders due for past future and present dates, but I want to count only the orders due for today.

    So in the report footer there is a textbox with a control set as:
    =IIF([orderdate]=Date(),Count([orderkey]),0)

    There is at least one order that is due today, however it still results in 0 as a result. I'm not getting any syntax error msgs, but I'm not ending up with what I need.

    Any suggestions?

  2. #2
    Join Date
    Oct 2002
    Location
    Greensboro, NC
    Posts
    50

    Re: IIF statement in report footer

    Hi,
    Instead of using Date() use Now()

    Originally posted by legendv
    I want to count the number of orders due for today at the end of a report. The report lists orders due for past future and present dates, but I want to count only the orders due for today.

    So in the report footer there is a textbox with a control set as:
    =IIF([orderdate]=Date(),Count([orderkey]),0)

    There is at least one order that is due today, however it still results in 0 as a result. I'm not getting any syntax error msgs, but I'm not ending up with what I need.

    Any suggestions?

  3. #3
    Join Date
    Dec 2002
    Posts
    34

    Re: IIF statement in report footer

    Are there time stamps on your order dates? That would make it damn near impossible to match.

  4. #4
    Join Date
    Jan 2003
    Location
    Aberdeen, Scotland, UK
    Posts
    168
    iif you edit the statement to say:

    iif(format([orderdate],"dd/mm/yy")=format(now(),"dd/mm/yy"),count([orderkey])

    that should fix it.

    Last edited by johncameron; 02-12-03 at 12:07.
    J.

  5. #5
    Join Date
    Apr 2002
    Location
    TX
    Posts
    34
    Thanks for your help!

    I placed a control box with IIF statement in detail section to obtain a value of 1 or 0 (that worked)
    then tried to sum those values - that didn't work. Heres what worked courtesy of Anthony

    =Dcount("[orderkey]","ReportRecordsource","[orderdate] = Date() ")

Posting Permissions

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