how to create a date with dynamic year, month, and day?

G

Guest

How to create a date with some interger values as month, day, and year, which
are returned from inside the current query?
eg. select DateDiff("h", #5/1/2003#, log_dt) from localData
where log_dt is a date field in table localData, and #5/1/2003# should be
built dynamically.

thanks,

wei
 
?

=?iso-8859-1?Q?J=F6rg_Ackermann?=

Hi,

wz schreibselte:
How to create a date with some interger values as month, day, and
year, which are returned from inside the current query?
eg. select DateDiff("h", #5/1/2003#, log_dt) from localData
where log_dt is a date field in table localData, and #5/1/2003#
should be built dynamically.

DateSerial <F1> should help.

Joerg
 
V

Van T. Dinh

You can use the DateSerial() function or you can construct the hash
(#)-delimited String like your example (and Access will convert it to a Date
value for you).

Check Access VB Help on the DateSerial() function.
 

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