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