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

#error in date calculation

Status
Not open for further replies.

bdm1

Programmer
Feb 4, 2002
75
US
I am using the query grid to calculate a future date based on a specific date field. All is fine except #error appears if there is no value in the specific date field. This is the code in the query grid:

Next IEP: DateSerial(Year([Last iep date]),Month([Last iep date])+6,Day([Last iep date]))

I have tried various ways to avoid the #error but can't seem to get the syntax right. Any help is much appreciated.

Bdm
 
Next IEP: IIf([Last iep date] Is Null, Null, DateSerial(Year([Last iep date]),Month([Last iep date])+6,Day([Last iep date])))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



Hi,

How about...
[tt]
Next IEP: IIF([Last iep date]=0,[Last iep date],(DateSerial(Year([Last iep date]),Month([Last iep date])+6,Day([Last iep date])))
[/tt]
Might also be IIF([Last iep date] Is Null...

Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top