Queries about changing date format

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

Guest

I have a table that has a date in it and it also has the time. I need to get
rid of the time and leave the date. What is the best way to do this?
 
In a query? Just use format to return the date you want.

DateOnly: Format([YourFieldName],"short date")
 
Why do you need to change the way you store it? In your reports and forms
use the format and Input mask options
 
There's a number of ways you can do this. The simplest, if you don't want
to change the underlying data in you table, is to use a calculated field in
your query, such as:

DateOnly: DateValue([NameOfYourExistingDateTimeField])

If you really want to get rid of the time component from your data, you can
run an update query using this expression, such as:

UPDATE YourTableName SET NameOfYourExistingDateTimeField =
DateValue([NameOfYourExistingDateTimeField]);

Doing this means that you will lose the time information forever. But
that's your call ;-)

HTH,

Rob
 
Back
Top