join two strings into a date time format asp classic

Hi Expert,

I have two variables X and Y. X has a date as a string(12-Jun-2013) and Y has a time (12:46 pm) I need to put these two together into a date time format before inserting in into a database. Does anyone know what function I need to use to do this?

Thanks in advance for any recommendations or solutions.
Last updated:6/20/2013 6:54:59 AM

1 Answers

Sumit Kesarwani
Sumit Kesarwani

Hi Lois,

Append your two string, with a space, and use the CDate function to convert the whole thing to a date. So: CDate('12-Jun-2013 12:46 pm') will return the date-time value.