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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Statement Problem

Status
Not open for further replies.

backer

Technical User
Apr 13, 2001
24
US
I would like my report to print “Overdue” only when nothing has been received from A, i.e., the “Date from A” is Null AND the Days Held exceeds the “DaysR”. Below are the expressions I am using. The problem – I am getting “Overdue” for items that have not yet been returned (but don’t exceed the DaysR). Can someone tell me what I am doing wrong.

Date_Rqd_AR: [Date_to_A] + [DaysR]

DaysR2: IIF([Date_to_A]isNull,””, [DaysR])

Days_Held_A: IIF(isNull([Date_from_A]), Date()-[Date_to_A], [Date_from_A]-[Date_to_A])

T: IIF(isNull([Date_from_A]) AND ([Days_Held_A]>[DaysR2]), “OVERDUE”,””)
 
It appears that if [Date_to_A] is null the value in DaysR2 will be an empty string. When you compare if Days_Held_A is greater than DaysR2, any non-empty value in Days_Held_A will be greater.

I'm not sure when Date_to_A will be null, but this may be your problem.
 
Thnaks for the reply. You are correct, this was one of my problems. I have made some changes and testing them. I think I have it figured out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top