rreister
asked on
SQL Server, Convert Military to Standard Time
Here is my current SQL:
SELECT (startDate + ' From ' + startTime+ ' To ' + endTime) AS FullTime, dateTimeKey
FROM DatesTimes
WHERE DatesTimes.reservationKey = 79
startTime and endTime are being stored in the database as Strings. The hold time values in hh:mm military format. I would like to pull these values from the database and store them in FullTime but having a standard time format rather than military (with AM or PM showing).
I tried this, but it didn't work:
SELECT convert(startTime, 108) AS Starting, convert(endTime, 108) AS Ending,
(startDate + ' From ' + Starting + ' To ' + Ending) AS FullTime, dateTimeKey
FROM DatesTimes
WHERE DatesTimes.reservationKey = 79
Any help would be most appreciated.
SELECT (startDate + ' From ' + startTime+ ' To ' + endTime) AS FullTime, dateTimeKey
FROM DatesTimes
WHERE DatesTimes.reservationKey = 79
startTime and endTime are being stored in the database as Strings. The hold time values in hh:mm military format. I would like to pull these values from the database and store them in FullTime but having a standard time format rather than military (with AM or PM showing).
I tried this, but it didn't work:
SELECT convert(startTime, 108) AS Starting, convert(endTime, 108) AS Ending,
(startDate + ' From ' + Starting + ' To ' + Ending) AS FullTime, dateTimeKey
FROM DatesTimes
WHERE DatesTimes.reservationKey = 79
Any help would be most appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome
ASKER