-
Need 2 digit month returned; not 1 digit
How can I return a 2 digit month into a variable for the months Jan thru September
SELECT DATEPART(mm, GETDATE()) ---> returns 9 for September.. I need 09 returned in order to properly build my target file name...
Thx,
BT
-
Need 2 digit month returned; not 1 digit (reply)
use this code
select left(CONVERT ( char(20) , getdate() , 101 ),2)
------------
BTphila at 9/5/01 10:13:28 AM
How can I return a 2 digit month into a variable for the months Jan thru September
SELECT DATEPART(mm, GETDATE()) ---> returns 9 for September.. I need 09 returned in order to properly build my target file name...
Thx,
BT
-
Need 2 digit month returned; not 1 digit (reply)
select right(CONVERT ( varchar(20) , getdate() , 101 ),2)
------------
Rajesh Chopra at 9/5/01 1:46:54 PM
use this code
select left(CONVERT ( char(20) , getdate() , 101 ),2)
------------
BTphila at 9/5/01 10:13:28 AM
How can I return a 2 digit month into a variable for the months Jan thru September
SELECT DATEPART(mm, GETDATE()) ---> returns 9 for September.. I need 09 returned in order to properly build my target file name...
Thx,
BT
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
|
|