List Info

Thread: Re: Regarding Date format in Sql server




Re: Regarding Date format in Sql server
country flaguser name
India
2007-10-16 08:49:39
After getting server date u can convert tht into .net datetime object and from tht u can get in the format u need.
 
sqlcommand cmd=new sqlcommand("select getdate()",conn)
Datetime dt=convert.todatetime(cmd.ExecuteScalar());
dt.DayOfWeek + dt.ToString("dd MMM,yyyy")


From: TechdotNetIndiagooglegroups.com [mailto:TechdotNetIndiagooglegroups.com] On Behalf Of ramireddy.s
Sent: Tuesday, October 16, 2007 07:04 PM
To: TechdotNetIndiagooglegroups.com
Subject: [.NetIndia] Regarding Date format in Sql server

Hai all,
 
I have  a problem while retrieving the date like the following format.
 
"  Wed Sep 19 , 2007 "
 ;
I have tried like this way..
 
select CONVERT(varchar,getdate(),107)
 
But i am getting like this fashion.
 
"Oct 16, 2007"
 
I want day has to be come in the first..
 
Could you able to help me in this regard asap.
 
 
Rgrds
Rami reddy. S
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups ".NetIndia" group.
To post to this group, send email to TechdotNetIndiagooglegroups.com
To unsubscribe from this group, send email to TechdotNetIndia-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/TechdotNetIndia?hl=en
http://www.satheeshbabu.com
http://www.satheeshbabu.blogspot.com/
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )