Hello, I am having some difficulty with some sql. I want to convert datetime into varchar. On the database it is displayed as datetime like this:
1999-01-01 00:00:00.000
My code looks like this:
Declare @Date varchar(200)
SELECT @date = Date from table
SELECT LEFT(CONVERT(VARCHAR,@date , 130), 11)
This grants me this output:
Jan 1 1999
As you can see from the output, it makes a double space between "Jan" and "1". Is there a way I can make it say "Jan 1 1999" rather than "Jan 1 1999" or perhap if there is a way to put the actual value of the datetime into a varchar "1999-01-01 00:00:00.000"