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 / Forms Programming / March 2007

Tip: Looking for answers? Try searching our database.

Text Format to Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Justin - 19 Mar 2007 02:39 GMT
I'm storing a date in a text field.  I want to insert it into a date field.  
What is the proper syntaxt?
Ken Snell (MVP) - 19 Mar 2007 02:57 GMT
By "storing a date in a text field", do you mean you're storing the string
of the date, for example, the string "3/18/2007" for March 18, 2007? If yes,
you can use the CDate function to convert the string to a real date value.

Is the date field in the same table, or in a different table? If it's in the
same table, this generic update query would work:

UPDATE YourTableName
SET YourDateField = CDate(YourTextField);

Signature

       Ken Snell
<MS ACCESS MVP>

> I'm storing a date in a text field.  I want to insert it into a date
> field.
> What is the proper syntaxt?
Justin - 19 Mar 2007 05:15 GMT
Thanks for the reply. The data is stored as "03/18/07".  I was using the
CDate() function, but it wasn't working.  I realized this was due to null
value fields.  I'm using the expersion
IIF(IsDate([myfield]),CDate([myfield]),Null) and it works.  Thanks.

> By "storing a date in a text field", do you mean you're storing the string
> of the date, for example, the string "3/18/2007" for March 18, 2007? If yes,
[quoted text clipped - 9 lines]
> > field.
> > What is the proper syntaxt?
 
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.