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 / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Calculate time based on an integer in another field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arnold R - 14 May 2005 05:40 GMT
I am trying to generate a field in a table that is a time (e.g.,8:15 AM).  
This time is to be calculated from another field which contains an integer.  
I want the time generated to be 7:30 AM plus 7.5 minutes times the number in
the other field (group number).  Can anyone tell me how to accomplish this?

Thanks for all help.
John Nurick - 14 May 2005 06:37 GMT
Hi Arnold,

I assume it's a calculated field you have in mind; there's no point
storing data that can easily be calculated whenever its needed.

If the time is stored in a date/time field, use something like this as a
calculated field in a query, or as the data source of a textbox on a
form or report:

 DateAdd("n", 7.5 * [GroupNumber], [TimeField])

If the time is stored in text field, try

 DateAdd("n", 7.5 * [GroupNumber], CDate([TimeField]))

>I am trying to generate a field in a table that is a time (e.g.,8:15 AM).  
>This time is to be calculated from another field which contains an integer.  
>I want the time generated to be 7:30 AM plus 7.5 minutes times the number in
>the other field (group number).  Can anyone tell me how to accomplish this?
>
>Thanks for all help.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Arnold R - 14 May 2005 07:14 GMT
John,

Thank you so much.  That works perfectly.  When I first looked at your reply
I was going to write back and ask what the "n" meant.  Then I tried to look
up the adddate function in help.  Unfortunately, the only thing there is an
example and there is no explanation of the function's syntax or effect.  I
surmised that the n meant minutes.  Can you point me to someplace that
explains the function?  Your help is much appreciated.

Thanks again.

> Hi Arnold,
>
[quoted text clipped - 22 lines]
>
> Please respond in the newgroup and not by email.
Douglas J. Steele - 14 May 2005 11:23 GMT
Even though this reference says it's for Access 97, it applies to all
versions:

http://msdn.microsoft.com/archive/en-us/office97/html/output/F1/d6/S5B206.asp

Signature

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

> John,
>
[quoted text clipped - 40 lines]
>>
>> Please respond in the newgroup and not by email.
Arnold R - 17 May 2005 04:53 GMT
Thanks very much.

> Even though this reference says it's for Access 97, it applies to all
> versions:
[quoted text clipped - 45 lines]
> >>
> >> Please respond in the newgroup and not by email.
 
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.