PC Review


Reply
 
 
John Thomas
Guest
Posts: n/a
 
      18th Sep 2003
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.
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      18th Sep 2003
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.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter Query For Selected Dates or All Dates Michael Microsoft Access Queries 2 13th Dec 2007 12:44 AM
Query always returns dates on report between current week dates david.isaacks@mail.va.gov Microsoft Access Reports 5 28th Jun 2006 09:07 PM
Entering variable dates into Query which a Summed query is based on Will Microsoft Access Queries 0 2nd Feb 2006 02:17 PM
Need table of all dates between two other dates as input to another query Benjamin White Microsoft Access 1 2nd Feb 2004 11:23 PM
Query that asks for dates x number of days away from today's date / comparing two fields in a query Mike H Microsoft Access Queries 2 22nd Dec 2003 08:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:53 AM.