Dates Query

J

John Thomas

I have a module set up which includes the following
calulation:

waittime = DateDiff("d", Nz([LastDNAdate], [bookdate]),
[cendate])

This works fine if there is a LastDNAdate in the field,
but when the LastDNAdate is blank then I get a value of
37864.

What am I doing wrong. I am pretty new to VB so a
detailed breakdown of how to correct my problem would be
helpful. Thanks.
 
A

Allen Browne

Sometimes Access misunderstands the data types, especially where unbound
controls, nulls, and Nz() are involved.

Try:
waittime = DateDiff("d", CVDate(Nz([LastDNAdate], _
[bookdate])), [cendate])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top