Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Statement returning #Error 1

Status
Not open for further replies.

iuianj07

Programmer
Sep 25, 2009
293
US
Hello guys,

I created an IIF statement to determine status of a due date field. I have 2 columns "DueDate" and "TodaysDate"

And the status column should be: When the today’s date is greater than the due date, have the status say ‘Past Due'. If today’s date is two days earlier than the due date, have it say “Two Days until Past Due”

I created this IIF statement, but it returns #Error.

Code:
IIf([TodaysDate]>[DueDate],"Past Due",IIf([TodaysDate]=([DueDate]-2),"Two Days until Past Due","N/A"))

For some reason, when I wrote this first and ran the query, the column has "N/A" on it. but I accidentally closed the query without saving. and when I re-wrote the query it now gives this error message. it might be strange on my part.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top