April 3, 2007 at 2:58 pm
hi peeps!
how do i convert from > 2002-03-12 00:00:00.000 to 2002-03-12
thx
April 3, 2007 at 3:16 pm
I don't see a SQL Style with dashes. You could try the following:
SELECT GETDATE(), CONVERT( varchar(10), GETDATE(), 112),
SUBSTRING( CONVERT( varchar(10), GETDATE(), 112), 1, 4) + '-' +
SUBSTRING( CONVERT( varchar(10), GETDATE(), 112), 5, 2) + '-' +
SUBSTRING( CONVERT( varchar(10), GETDATE(), 112), 7, 2)
I wasn't born stupid - I had to study.
April 3, 2007 at 3:19 pm
darn.....lol
thx lot man
April 3, 2007 at 3:21 pm
select getdate(), convert(varchar(10),getdate(),121)
April 3, 2007 at 3:33 pm
That's it, Michael! Did not see that number in my reference book.
I wasn't born stupid - I had to study.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply