The following data is output from our production control program :
Log-in times on the floor are split between 2 fields; [Beg Hour]
and [Beg Min] (both number formatted). The problem is, if someone logs
in @ 14:02, the [Beg Min] field records just a "2", so when I
concatenate the two fields, I get 14:2. Being a number field, [Beg
Min] won't recognize a leading zero when I try to add one, and
obviously, this is only an issue when [Beg Min] <=9.
What is the easiest way to achieve my goal of ending up with one
field, that in the above circumstance would read 14:02, AND be in the
proper Date/Time format for comparison with other date/time fields?
Thanks in advance to all who reply.
Rich
Klatuu - 17 Apr 2008 21:25 GMT
Format([Beg Hour], "00\:") & Format([Beg Min], "00")

Signature
Dave Hargis, Microsoft Access MVP
> The following data is output from our production control program :
> Log-in times on the floor are split between 2 fields; [Beg Hour]
[quoted text clipped - 8 lines]
> Thanks in advance to all who reply.
> Rich
John Spencer - 17 Apr 2008 23:25 GMT
Which will be a text value. If you need to compare this to values in a
datetime field, you will probably need to wrap the expression in the
timevalue function.
OR use CDate on the string
Or use this expression
CDate((60*[Beg hour] + [Beg Min])/1440)
'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
> Format([Beg Hour], "00\:") & Format([Beg Min], "00")
Klatuu - 17 Apr 2008 23:32 GMT
Thanks, John, I forgot about the last bit

Signature
Dave Hargis, Microsoft Access MVP
> Which will be a text value. If you need to compare this to values in a
> datetime field, you will probably need to wrap the expression in the
[quoted text clipped - 14 lines]
>
> > Format([Beg Hour], "00\:") & Format([Beg Min], "00")
John W. Vinson/MVP - 18 Apr 2008 02:29 GMT
> What is the easiest way to achieve my goal of ending up with one
> field, that in the above circumstance would read 14:02, AND be in the
> proper Date/Time format for comparison with other date/time fields?
TimeSerial([Beg Hour], [Beg Min], 0)
will do it in one shot...
John Spencer - 18 Apr 2008 16:01 GMT
Dang! I forgot all about TimeSerial.
'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
>> What is the easiest way to achieve my goal of ending up with one
>> field, that in the above circumstance would read 14:02, AND be in the
[quoted text clipped - 3 lines]
>
> will do it in one shot...
Rich - 18 Apr 2008 16:07 GMT
On Apr 17, 9:29 pm, "John W. Vinson/MVP"
<please.re...@to.the.newsgroup> wrote:
> > What is the easiest way to achieve my goal of ending up with one
> > field, that in the above circumstance would read 14:02, AND be in the
[quoted text clipped - 3 lines]
>
> will do it in one shot...
Thanks to all who responded. As usual, the answers you all provided
were outstanding.
Rich