|
-
Sep 7th, 2006, 01:20 PM
#1
Thread Starter
Member
Time format in SQL
Hello,
I am taking datetime value from a table MA and separating date and time by using CONVERT function.
CONVERT(VARCHAR(12), MA.ArrivalDate, 101) AS ArrivalDate, '
CONVERT(VARCHAR(12), MA.ArrivalDate, 108) AS ArrivalTime,
but my ArrivalTime is coming as 13:01:00. I want to convert this time as 1:01:00. I have to do this conversion in my stored proc, not in my code. can you help ..? Thanks
-
Sep 7th, 2006, 02:58 PM
#2
Re: Time format in SQL
Use a style that does not return the time using the 24 Hour clock. Then parse out the time portion.
LTRIM(SUBSTRING(CONVERT(VARCHAR(30), MA.ArrivalDate, 109) , 12, 9)) AS ArrivalTime
Last edited by brucevde; Sep 7th, 2006 at 03:01 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|