Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / August 2005

Tip: Looking for answers? Try searching our database.

Date Conversion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 31 Aug 2005 16:03 GMT
Is there a way in Access to convert a date in format "mdy - 08/05/2005"
to "ymd - 2005-08-05" using an update query?
Allen Browne - 31 Aug 2005 16:19 GMT
No. You cannot alter the date with an update query, because internally
Access stores the date/time data as a floating point number, where the
integer part represents the date and the fraction represents the time of
day. The format is applied at display time, so it does not make sense to
talk about altering the stored data to match a display.

The data is displayed to the user according to how they have dates defined
in Regional Settings in the Windows Control Panel. You could therefore alter
your settings there, and Access would display the dates that way. Of course
the change would affect all your other well-behaved Windows programs as
well.

If that is not acceptable, you can use the Format property of the field in
the table to specify how the data should be displayed. Or, you could even
set the Format property of the field in the query.

Note that literal date/time values in VBA code or SQL statements is NOT
affected by your regional settings. For more info on that and the 3 cases
where Access tends to misunderstand dates, see:
   International Date Formats in Access
at:
   http://allenbrowne.com/ser-36.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Is there a way in Access to convert a date in format "mdy - 08/05/2005"
> to "ymd - 2005-08-05" using an update query?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.