Combining date and time into one field

Status
Not open for further replies.

Dave M

Member
Outlook version
Email Account
Exchange Server 2007
Hello,

I would like to take the date portion of one field and combine it with the time portion of another field in a third field in a custom form. I'm familiar with the datevalue() and timevalue() functions, but can't seem to get the syntax right to have the third field display properly. Any help would be greatly appreciated.

Field1 = "9/18/14 7:00am"
Field2 = "10/2/14 12:00pm"

would like Field3 to equal "9/18/14 12:00pm"

Thanks,

Dave M.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
This should work -
field3 = DateValue(field1) & " " & TimeValue(field2)
will display as 9/18/2014 12:00:00 PM

for other date/time formats, you need to use format()
DateValue(field1) & " " & Format(TimeValue(field2), "hh:mmampm")
returns
9/18/2014 12:00PM

for lowercase am/pm, use /
Format(TimeValue(field2), "hh:mmam/pm")
9/18/2014 12:00pm
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Sorry, I missed the 2 digit year.
Format(DateValue(field1), "m/d/yy") & " " & Format(TimeValue(field2), "hh:mmam/pm")
9/18/14 12:00pm
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
RBLampert Combining PSTs Using Outlook 1
mwh1962 combining pst & ost calendars & contacts with Office 365 Using Outlook 5
W combining outlook accounts Using Outlook 0
M How to set exchange calendar as default when combining with Internet calendar Using Outlook 2
D Outlook 2010 and combining multiple rules into one? Using Outlook 4
D Combining multiple messages into a single task Using Outlook 3
J Combining data from two fields Outlook VBA and Custom Forms 3
S Outlook Macro for [Date][Subject] Using Outlook 1
N Save emails within a certain date range to network drive Outlook VBA and Custom Forms 0
kburrows Reset Date to Keep Tasks from Archiving Using Outlook 9
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
DDB VBA to Auto Insert Date and Time in the signature Outlook VBA and Custom Forms 2
P Short Date Format when typing in a task Using Outlook 2
S Change "This Week" flag start date behavior Using Outlook 1
S Archiving and Likely Modified Date Problem Using Outlook 3
A VBA Script - Print Date between first email in Category X and last email in Category Y Outlook VBA and Custom Forms 3
S Outlook 2016 Arrange tasks by date, additional custom sorting, but still use friendly terms like Today, Tomorrow, This week? Using Outlook 1
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 17
S save attachment with date & time mentioned inside the file Outlook VBA and Custom Forms 0
witzker Pls help to change the code for inserting date in Ol contact body Outlook VBA and Custom Forms 5
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 2
M Sorting by Day in Date Column Advanced Filter BCM (Business Contact Manager) 1
V Date and/or time error in Outlook Form Outlook VBA and Custom Forms 0
S Body text of Email from invite date/time Outlook VBA and Custom Forms 7
V 10 Years calenders -single date together Exchange Server Administration 8
O Export Outlook calendar appointments by filters and date range Outlook VBA and Custom Forms 1
D Add date next to day name in Outlook Today calendar view Using Outlook 1
X If you change expiration date of repeated task it dupplicates Using Outlook 1
D Archive by receive date not working Using Outlook 2
V Making a Date field mandatory in outlook form Outlook VBA and Custom Forms 2
P Auto Insert Current Date or Time into Email Subject Outlook VBA and Custom Forms 2
L Ctrl Alt d date stamp use Using Outlook 1
A Create date folder and move messages daily Outlook VBA and Custom Forms 1
witzker Outlook 2010 Insert Date & Time at the button of an OL contactform in red Using Outlook 2
O Tasks - Is there a postponed date column? Using Outlook 7
J Command Button to stamp a date and time in a textbox in Outlook 2016 Outlook VBA and Custom Forms 3
K Outlook Archive to PST Files by Date Range VBA Script? Outlook VBA and Custom Forms 1
W Save and rename outlook email attachments to include domain name & date received Outlook VBA and Custom Forms 4
F Finding Meetings/Tasks in a date range Using Outlook 1
W Save Outlook attachment in network folder and rename to current date and time Outlook VBA and Custom Forms 18
M Macro to add date/time stamp to subject Outlook VBA and Custom Forms 4
V Changing default date for task follow-up buttons Using Outlook 2
J Old unread emails on current date (MDaemon Server) Using Outlook 1
D Outlook macro with today's date in subject and paste clipboard in body Outlook VBA and Custom Forms 1
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
B Search by date macro Outlook VBA and Custom Forms 0
S set a flag task date as the next weekday Outlook VBA and Custom Forms 4
K Daily task list > show tasks on the exact due date and not on the "current date" Using Outlook 1
S Outlook User defined date field (UDF) not syncing Using Outlook 2
I Email Replied for first time Date/Time Outlook VBA and Custom Forms 2

Similar threads

Top