March 12, 2014 at 1:35 pm
hi all,
please help me to get this out put.
details:
declare @deadline Datetime = '2014-03-23 15:30:10.000'
SELECT CONVERT(VARCHAR(30),@deadline, 100) AS DateConvert
----With this I am able to produce that like
----o/p: Mar 23 2014 3:30PM
declare @deadline1 Datetime = '2014-03-03 15:30:10.000'
SELECT CONVERT(VARCHAR(24),@deadline1, 100) AS DateConvert
--o/p: Mar 3 2014 3:30PM
--expected O/p: Mar 03 2014 03:30PM
Please suggest the correct date format to achieve this.
March 12, 2014 at 1:40 pm
A replace can work for you.
SELECT REPLACE( CONVERT(VARCHAR(24),@deadline, 100), ' ', ' 0')
March 12, 2014 at 1:47 pm
thank you so much for your help.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply