Hello People,
I'm in need of help, just can't get my head around why this doesn't work?
I'm dealing with 3 or 4 fields names, Indate: [ExpireDate], [CurrentDocVer], [TrainedVerNo]
The idea is: If the [Expiredate] is > than today then the named field Indate: replies "Expired" else "Live" also, if [CurrentDocVer] > [TrainedVerNo] replies "Expired" else "Live"
So in the field named Indate:, I have this and it seems to work fine:-
Indate: IIf([ExpireDate]>Date(),IIf([CurrentDocVer]>[TrainedVerNo],"Expired","Live"))
Two things. although this works fine with data fields that have data in, I can't seem to get it to handle blanks. eg if [ExpireDate] has no date or [TrainedVerNo] is empty.
Let me try to explain a little more; [ExpireDate] is calculated from a data field called [RegistrationDate] in other words, its the date the person was trained. If this field is blank ie person not trained yet, then [ExpireDate] is also blank.
Therefore, in my world I'd like to add this field to the line of code to say if RegistrationDate is blank then Indate = "Expired" else "Live"
Indate: IIf([ExpireDate]>Date(),IIf([CurrentDocVer]>[TrainedVerNo],IIf ([RegistrationDate]="","Expired","Live")))
This turns out to be rubbish! This line then blanks out all the data fields that has data and just fills in the ones that are blank. I've also tried Nz in front of things
Indate: IIf(Nz([ExpireDate]>Date()),IIf(Nz([CurrentDocVer]>[TrainedVerNo]),IIf (Nz([RegistrationDate]=""),"Expired","Live")))
Also, looked at Is Null and get the same sort of rubbish reply's.
Please help, its been days on this now and I'm slowly loosing the will to live.
Regards,
Mike
I'm in need of help, just can't get my head around why this doesn't work?
I'm dealing with 3 or 4 fields names, Indate: [ExpireDate], [CurrentDocVer], [TrainedVerNo]
The idea is: If the [Expiredate] is > than today then the named field Indate: replies "Expired" else "Live" also, if [CurrentDocVer] > [TrainedVerNo] replies "Expired" else "Live"
So in the field named Indate:, I have this and it seems to work fine:-
Indate: IIf([ExpireDate]>Date(),IIf([CurrentDocVer]>[TrainedVerNo],"Expired","Live"))
Two things. although this works fine with data fields that have data in, I can't seem to get it to handle blanks. eg if [ExpireDate] has no date or [TrainedVerNo] is empty.
Let me try to explain a little more; [ExpireDate] is calculated from a data field called [RegistrationDate] in other words, its the date the person was trained. If this field is blank ie person not trained yet, then [ExpireDate] is also blank.
Therefore, in my world I'd like to add this field to the line of code to say if RegistrationDate is blank then Indate = "Expired" else "Live"
Indate: IIf([ExpireDate]>Date(),IIf([CurrentDocVer]>[TrainedVerNo],IIf ([RegistrationDate]="","Expired","Live")))
This turns out to be rubbish! This line then blanks out all the data fields that has data and just fills in the ones that are blank. I've also tried Nz in front of things
Indate: IIf(Nz([ExpireDate]>Date()),IIf(Nz([CurrentDocVer]>[TrainedVerNo]),IIf (Nz([RegistrationDate]=""),"Expired","Live")))
Also, looked at Is Null and get the same sort of rubbish reply's.
Please help, its been days on this now and I'm slowly loosing the will to live.
Regards,
Mike