Sometimes Access misunderstands the data types, especially where unbound
controls, nulls, and Nz() are involved.
Try:
waittime = DateDiff("d", CVDate(Nz([LastDNAdate], _
[bookdate])), [cendate])
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
"John Thomas" <(E-Mail Removed)> wrote in message
news:0d2201c37dcd$fba0c150$(E-Mail Removed)...
> 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.