Discussion:
Date and Time
(too old to reply)
m***@gmail.com
2012-12-15 04:43:52 UTC
Permalink
I have two fields with Date and Time. I would like to put these two fields into one. Which function will do that?

Field 1: 12/14/2012
Field 2: 20:00

and will become

Field 3: 12/14/2012 8:00 PM

Thanks
John W. Vinson
2012-12-15 05:38:37 UTC
Permalink
Post by m***@gmail.com
I have two fields with Date and Time. I would like to put these two fields into one. Which function will do that?
Field 1: 12/14/2012
Field 2: 20:00
and will become
Field 3: 12/14/2012 8:00 PM
Thanks
Just add them.

An Access Date/Time field is stored as a Double Float number; the integer
part, before the decimal, is the number of days since midnight, December 30,
1899; the fractional part is the fraction of a day since last night's
midnight:

?now; cdbl(now)
12/14/2012 10:37:26 PM 41257.942662037

So:

DateTime: [Datefield] + [Timefield]

will give the date and time (assuming that the two textboxes in fact contain
what you think they do...)
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
Loading...