issues with IIF expression

Lostsamoan

Registered User.
Local time
Today, 02:45
Joined
May 1, 2008
Messages
12
gonna try to keep this simple. i have 3 columns

Training Datex

Training Date

Training Dates

Datex either displays a blank or 00/00/0000 (based on a previous query)

Date display the training date if it was done. also could display a blank if no training has been done. if there is training date it is displayed as yyyy/mm (for example"2012/06" ) just for info it is in text format

Dates is where i am having the problem.

Training Dates: IIf([Training Date]=NULL,[Training Date],[Training Datex])

what i want is if training date is blank, use value of training datex(regardless if it is blankor not) if training date is not blank us training date value .

any help would be much a appreciated. and also sorry about the confusing names

Much mahalo
 
sorry meant

Training Dates: IIf([Training Date]=Null,[Training Datex],[Training Date])
 
figured out myself

Training Dates: IIf(IsNull([Training Date]),[Training Datex],[Training Date])
 
You could also use the Nz() function;
Code:
Nz([Training Date],[Training Datex])

As an aside it's best to avoid using spaces and other special charters in Object and Control names, stick with alpha an numeric character and the underscore.
 
I have never seen a good reason to store any data involving dates as anything but a Date type. Using any other type becomes complex as soon as any calculations are attempted.

A particular month can be designated as 1/mm/yyyy and displayed in any format you could require.
 
I just want to thank both of you for the tips. the NZ worked great. obviously i am not that expierenced with access. lol the Database that my job had me create is a bit crazy. but anyways thank you so much i learn a lot everytime i post here:-)

Much Mahalo
 

Users who are viewing this thread

Back
Top Bottom