Author |
Topic |
awadi20
Starting Member
10 Posts |
Posted - 2007-06-25 : 17:58:38
|
hello,i use asp.net 2, i have a sql database, it has a datetime field,the data in this field like 25/06/2007. when i selected this recode in asp.net and fill data in a grid it display like 25/06/2007 12:00:00 AM.how can i get the data dd MM yyyy? |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-06-25 : 18:00:40
|
Use the dataformatstring at the front end.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
awadi20
Starting Member
10 Posts |
Posted - 2007-06-26 : 03:35:22
|
thanks for ur replay. but this is the first time i use asp.net2 so would u please to explane more. how can i do that. i have two selected item will fill in the gride, the first one is (nvarchar) and the second is date.tanks a lot |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
|
awadi20
Starting Member
10 Posts |
Posted - 2007-06-26 : 18:41:38
|
i used this statment select convert(char(10), the field name,111)this display date as 2007/06/25 buthow can i display it like 2007/06/25 monday |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-06-26 : 19:54:11
|
[code]SELECT CONVERT(CHAR(10), GETDATE(), 111) + ' ' + DATENAME(weekday, GETDATE())[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
awadi20
Starting Member
10 Posts |
Posted - 2007-06-27 : 02:34:41
|
thanks khtan for ur help, it works now |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-06-27 : 02:49:15
|
Note that you can do this more easily and efficiently from the Front-end rather than from SQL.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-06-27 : 08:57:06
|
I dont know .NET syntax. In VB6, it would beFormat(Rs("datecol"),"yyyy/mm/dd dddd")MadhivananFailing to plan is Planning to fail |
 |
|
awadi20
Starting Member
10 Posts |
Posted - 2007-06-27 : 18:24:42
|
thank u all for ur help |
 |
|
|