Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Part of a field when it's a date/time with BOTH data types

Status
Not open for further replies.

Viv1

Programmer
Dec 9, 2003
42
GB
Hi,

I am using a database which has a field called start_time in an Interview table, this is type: Date/Time. The problem is that data shows like this in the query result: 01/01/1900 10:30:00

I would like to extract only the time part but this doesn't seem to be working.

Any ideas so I can get the result to show: 10:30:00??

Thanks, Viv
 
Perhaps Format([start_time], 'hh:nn:ss') is what you need.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Try the DatePart() Function

Dim TheDate As Date
Dim Msg
TheDate = InputBox("Enter a date:")
Msg = "Hour: " & DatePart("h", TheDate)
MsgBox Msg

 
Hi,

Thanks for your suggestions....managed to get it working using the Mid function.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top