mlcktmguy
asked on
Combine Short Date field and Short Time Field into One Date/Time Field
The user in my application need to record the Date and Time of an event on a form. They asked that the two fields be split into an EventDate(Short Date) and EventTime(shortTime) fields. They feel it is easier to enter them individually. The date is entered as short date (12/23/14) and the time is entered as short time (13:24). When I store the records I want to store a combined date and time. How do I ocmbine these two individual fields into one consolidated Date/Time
The form:
Event Date
Event Time
The form:
Event Date
Event Time
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What matthewspatrick said is even simpler:
EventDateTime = EventDate + EventTime
EventDateTime = EventDate + EventTime
If the text boxes are set to have the format as date and time the the data type should be correct and you can simply add them together
If that does not work then try wrapping with CVDate().
Example:
If that does not work then try wrapping with CVDate().
Example:
? CVDate("12/31/2012") + CVDate("13:24")
12/31/2012 1:24:00 PM
EventDateTime = EventDate & " " & EventTime