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

Null fields in report 1

Status
Not open for further replies.

qwerty70

Technical User
Dec 13, 2005
73
GB
Please help the novice. My rptVisa report has 3 bound fields:

Date1
Date2
Date3
Date4

Also, I have created a unbound field called txtExpiry.

Here's the scenario: If Date1, Date2, Date3 & Date4 fields are not null, then today's date minus Date4 and the result should appear in txtExpiry (this is the number of days between current date and Date4).

If Date4 is null, then today's date minus Date3.... so forth and so on until it checks whether Date1 field is null or not. But if Dates1 to Dates4 fields are empty then I want a remark "Not Required" to appear in the txtExpiry field.

Your help is much appreciated. Thanks in advance.

regards,

qwerty70
 
How about:
IIf(Not IsNull(Date4), Date - Date4, IIf(Not IsNull(Date3),
Date - Date3, IIf(Not IsNull(Date2), Date - Date2, IIf(Not IsNull(Date1), Date - Date1, "Not Required"))))
 
Remou, thank you so much. It worked!

regards

qwerty70
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top