Simple T-SQL problem adding a 0 with a field (1 Viewer)

GOVMATE

Registered User.
Local time
Today, 00:43
Joined
Aug 10, 2007
Messages
71
Hello,

I am having a small problem inserting a 0 in a text field that contains a date. I work with large amounts of data derived from other systems and I have to format them to meet the requirements to be feed into others. I need a query that will only insert a 0 to the single digit day within a date where a text field date looks like say 01/2/1998 and I need it to look like 01/02/1998.

Thanks in advance for any help!!!:
 

pdx_man

Just trying to help
Local time
Today, 00:43
Joined
Jan 23, 2001
Messages
1,347
This is not a simple T-SQL problem, but rather a formatting issue. In Access, a quick fix would be:

Format("01/2/1998","mm/dd/yyyy")

A T-SQL fix would involve using the CONVERT function. Refer to BOL.
 

Users who are viewing this thread

Top Bottom