A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Convert number to time



 
 
Thread Tools Display Modes
  #1  
Old July 20th, 2008, 03:03 AM posted to microsoft.public.access.queries
Floyd Forbes
external usenet poster
 
Posts: 31
Default Convert number to time

I have field with numbers like 28815. How do I convert this number to
8:00:15 AM time format.
Is there an easy way to convert numbers to time?

Floyd


  #2  
Old July 20th, 2008, 12:21 PM posted to microsoft.public.access.queries
Bob Barrows [MVP]
external usenet poster
 
Posts: 441
Default Convert number to time

Floyd Forbes wrote:
I have field with numbers like 28815. How do I convert this number to
8:00:15 AM time format.
Is there an easy way to convert numbers to time?

Floyd

Could you show a few more examples? For instance, how is a PM time
represented?

With this specific example, you would use string functions to parse out the
hours and minutes and use timeserial to convert it to time:

MyTime: TimeSerial(Mid([fieldname],3,1),right([fieldname].2),0)

but this will likely not be adequate for all your data.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:59 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.