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 2 / January 2008

Tip: Looking for answers? Try searching our database.

separating Date and Time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Welthey - 23 Jan 2008 01:40 GMT
I need to separate a datetime field and just show date.  I've seen the posts
regarding TimeValue but I'm not having any luck with this.

The field is set up as a text field and the data looks like this :
11/30/1999 2:17:52 PM

I've used this in my query :

Mod Action Time : TimeValue(Mid([ACTIONTIME],9,2) & ":" &
Mid([ACTIONTIME],11,2))  

where mod action time is a new blank field and ACTIONTIME is the existing
text field described above.  Please help.

Thank you,

Welthey
Tom van Stiphout - 23 Jan 2008 04:38 GMT
Use the Format function:
format(#11/30/1999 2:17:52 PM#,"mm/dd/yyyy")
=> 11/30/1999

-Tom.

>I need to separate a datetime field and just show date.  I've seen the posts
>regarding TimeValue but I'm not having any luck with this.
[quoted text clipped - 13 lines]
>
>Welthey
John W. Vinson - 23 Jan 2008 05:46 GMT
>I need to separate a datetime field and just show date.  I've seen the posts
>regarding TimeValue but I'm not having any luck with this.
[quoted text clipped - 13 lines]
>
>Welthey

You're making it too hard. From the Immediate window:

?datevalue("11/30/1999 2:17:52 PM")
11/30/1999
?timevalue("11/30/1999 2:17:52 PM")
2:17:52 PM

Just use TimeValue([ACTIONTIME]) or DateValue([ACTIONTIME]) as needed.

            John W. Vinson [MVP]
 
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



©2009 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.