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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

BIG problem: Time stored as text & cannot re-format table



 
 
Thread Tools Display Modes
  #1  
Old December 19th, 2008, 11:25 AM posted to microsoft.public.access
Cita
external usenet poster
 
Posts: 17
Default BIG problem: Time stored as text & cannot re-format table

Morning all-

Here's my goal:

I have to take "Start Time" + "Max Hours" - "Break" = "End Time".

Here are my problems:

"Start Time" is a text field and I am unable to change the format of the
field in the table (it'll mess up the entire system). To add to the fun, this
is also Zulu time so I cannot use "TimeValue" as it will take 0801 and make
it 8:01 AM which is incorrect.

"Max hours" and "Break" are from formulas (ie IIf statements, etc.) and are
not stored as hours or minutes, just as general numbers (I guess).

So, right now, it looks like this if you try to get to my goal:

0801 + 15 - 0.25 = 814.2358645

I'm stuck and frustrated so any suggestions are highly appreciated.



  #2  
Old December 19th, 2008, 11:56 AM posted to microsoft.public.access
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default BIG problem: Time stored as text & cannot re-format table

Use TimeValue to convert it to a time, then use DateAdd to add or subtract
the appropriate number of hours to convert it to your local time. You'll
also need to use DateAdd to add max hours and subtract break. If you don't,
adding 15 will add 15 days, not 15 hours.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Cita" wrote in message
...
Morning all-

Here's my goal:

I have to take "Start Time" + "Max Hours" - "Break" = "End Time".

Here are my problems:

"Start Time" is a text field and I am unable to change the format of the
field in the table (it'll mess up the entire system). To add to the fun,
this
is also Zulu time so I cannot use "TimeValue" as it will take 0801 and
make
it 8:01 AM which is incorrect.

"Max hours" and "Break" are from formulas (ie IIf statements, etc.) and
are
not stored as hours or minutes, just as general numbers (I guess).

So, right now, it looks like this if you try to get to my goal:

0801 + 15 - 0.25 = 814.2358645

I'm stuck and frustrated so any suggestions are highly appreciated.





 




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 10:23 AM.


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