We help IT Professionals succeed at work.

Combine Short Date field and Short Time Field into One Date/Time Field

mlcktmguy
mlcktmguy asked
on
441 Views
Last Modified: 2012-08-14
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
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Try using
EventDateTime = EventDate & " " & EventTime
CERTIFIED EXPERT
Top Expert 2010
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
What matthewspatrick said is even simpler:
EventDateTime = EventDate + EventTime
CERTIFIED EXPERT
Top Expert 2011

Commented:
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

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.