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.
| Author |
Topic |
|
anup_phansa
Starting Member
6 Posts |
Posted - 2009-09-08 : 01:15:14
|
| How to format date in (23 March 2009 10:30 pm) in select statement Hi AllMy field data type is datetime , actually data save in given below format 2009-06-12 12:14:42.0802009-06-12 12:21:36.7502009-06-12 12:20:12.627Regards Anup |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-09-08 : 01:18:03
|
please perform the required date formatting in your front end application.If you have to do it in SQL, check out CAST & CONVERT in Books On Line KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
anup_phansa
Starting Member
6 Posts |
Posted - 2009-09-08 : 02:05:37
|
| HiThanks for your replyi have try many option of convert function , but does not get exact output , please give proper option for convert function that give exact output Regardsanup |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-08 : 03:05:17
|
quote: Originally posted by anup_phansa How to format date in (23 March 2009 10:30 pm) in select statement Hi AllMy field data type is datetime , actually data save in given below format 2009-06-12 12:14:42.0802009-06-12 12:21:36.7502009-06-12 12:20:12.627Regards Anup
Where do you want to show formatted dates?MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-09-08 : 05:13:33
|
quote: Originally posted by anup_phansa HiThanks for your replyi have try many option of convert function , but does not get exact output , please give proper option for convert function that give exact output Regardsanup
you will have to use more than one style and concatenate itselect convert(varchar(11), getdate(), 113)+ right(convert(varchar(20), getdate(), 100), 8) It will be much easier to do it in your front end application. Why aren't you do it there ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
anup_phansa
Starting Member
6 Posts |
Posted - 2009-09-08 : 06:50:10
|
| Hi thank for youre reply , it's great , i get solution |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-08 : 08:42:59
|
quote: Originally posted by anup_phansa Hi thank for youre reply , it's great , i get solution
Have you read my first reply?MadhivananFailing to plan is Planning to fail |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
|
|
|
|
|
|
|