datepart funtion Problem
-
select convert(varchar(2),datepart(dd,travel_date))from booking_details this returns me :……. 15 21 24 8 5 But in this o/p I want 08 instead of 8 please suggest
-
select convert(varchar(2),datepart(dd,travel_date))from booking_details this returns me :……. 15 21 24 8 5 But in this o/p I want 08 instead of 8 please suggest
-
select convert(varchar(2),datepart(dd,travel_date))from booking_details this returns me :……. 15 21 24 8 5 But in this o/p I want 08 instead of 8 please suggest
This has nothing to do with VB or VB.NET. Ask this question in the SQL forum.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
This is the wrong forum for this question, but one answer might be: select right('0'+convert(varchar(2),datepart(dd,travel_date)),2) from booking_details Hope that helps. Ben