changing the date format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a column called Date which is used to store the date when receipt is
created on our system, till today ive been inserting the value using the
now() function but i found that when i try to filter for receipts based on a
date no results are returned, this is due to now() storing both the time and
date, ive since changed my funtion to int(now()) to store only the date
porttion but how can i update the previous dates to have only the date part
of the value?

with much thanks

Amit
 
i solved this myself using

Int([Date])

hopefully it will help someone else out there in a similar prediciment
 
1. Make a backup of the mdb file. You are about to make a bulk update.

2. Create a query that uses this table.

3. Change it to an Update query (Update on Query menu.)
Access adds an Update row to the design grid.

4. Drag the date/time field into grid.

5. In the Update row under this field, enter:
DateValue([Date1])
replacing Date1 with the name of your date field.

6. Run the query.

BTW, you can use Date() instead of Now() to assign just the date.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

in message
news:[email protected]...
 
First, why not just use the Date() function which returns only the date
instead of Int(Now()) which requires 2 function calls per row instead of 1?

To change your column named Date (bad name, it is an Access Reserved Word
and could cause problems), you can write an update query with the update to
as:
DateValue([Date])

This will strip the time off those rows with times, but not affect those
without them.
 
Back
Top