Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Date format

Author  Topic 

maxxsqlserver
Starting Member

6 Posts

Posted - 2007-11-27 : 06:05:32
But, How can i get the date like this format '20071126' from code? is there a method in cSharp that allow this?
Thanks

Maxx

ranganath
Posting Yak Master

209 Posts

Posted - 2007-11-27 : 06:22:46
hi,

Try this

SELECT dateadd(day,datediff(day,0,getdate()),0)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-11-27 : 07:47:35
quote:
Originally posted by maxxsqlserver

But, How can i get the date like this format '20071126' from code? is there a method in cSharp that allow this?
Thanks

Maxx


I think in C#, you can use something like

datecol.tostring("YYYYMMDD")

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -