Link to home
Start Free TrialLog in
Avatar of mlcktmguy
mlcktmguyFlag for United States of America

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
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Try using
EventDateTime = EventDate & " " & EventTime
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What matthewspatrick said is even simpler:
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:
? CVDate("12/31/2012") + CVDate("13:24")
12/31/2012 1:24:00 PM 

Open in new window