Wednesday, October 03, 2007

Removing Time from a date field

I was faced with a date field (called eDate) that also held time values as well as the date for some entries. To remove the time from the date-time entry, I used the following update query

UPDATE eInvoices SET eInvoices.edate = Format([edate],"dd-mmm-yyyy") WHERE (((Format([edate],"Short Time"))<>"00:00"));

1 comment:

Owen Jenkins said...

Hi Garry,
Since date/time fields are stored as numeric values with the date to the left and the time to the right of the decimal point, you could also use [edate]=Int([edate]).