Link to home
Start Free TrialLog in
Avatar of rreister
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.
ASKER CERTIFIED SOLUTION
Avatar of muzzy2003
muzzy2003

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
Avatar of rreister
rreister

ASKER

It worked perfectly!  Thanks so much for quick and easy reply!
You're welcome