Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

#Error in query, Date

experts, I get a #error in the attached query.  I know the reason but I dont know how to fix.  If you delete the date in  [UltimateExpirey] then the #error goes away.  

here is the calculation:  
NotifyByDate: IIf([DateOfExpirey]<[UltimateExpirey],[DateOfExpirey]-Format(Nz([tblAutoExtend_Evergreen].[DaysNotice],0),"m/dd/yyyy"),Format([DateOfExpirey]-Nz([tblAutoExtend_Evergreen].[DaysNotice],0),"m/dd/yyyy"))

Please open attached and open the query "error".  There are 2 tables and 1 query.  

thank you.
EE.accdb
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

that was amazing.  It worked.  Thanks for that tip to make a function.   It makes a lot of sense.   Leaving the office on a good note!  have a good weekend.
pdvsa,

Make sure that logic is correct!  It is not configured exactly like your IIF() statement was.

Have a good weekend.

Dale
Avatar of pdvsa

ASKER

Fyed, yes, I discovered I had to tweak it just a bit.  It works great!  Thank you