Date and Time

T

Tony Ramirez

I am using a Append Query to add data to a table. I want the Field in the
query to add the current date and a time value of 08:00:00 AM. Basically the
query is going to be used on Holiday's to automatically punch in an employee.
I can add a date but cant seem to get it to write the date and specific time.
Thanks for your help.
 
D

Douglas J. Steele

Don't think so.

Date() + #08:00:00# would make more sense, or Date() + TimeSerial(8, 0, 0)
 
O

Ofer

Tried it on update query before, and worked.



Douglas J. Steele said:
Don't think so.

Date() + #08:00:00# would make more sense, or Date() + TimeSerial(8, 0, 0)
 
D

Douglas J. Steele

While it may work, it's relying on data type coercion. A date is a numeric
value, and you're concatenating a string to it. It's far safer to add the
number representing the date to the number representing the time.
 
O

Ofer

Thanks


Douglas J. Steele said:
While it may work, it's relying on data type coercion. A date is a numeric
value, and you're concatenating a string to it. It's far safer to add the
number representing the date to the number representing the time.
 
Top