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
 General SQL Server Forums
 New to SQL Server Programming
 datetime problem?

Author  Topic 

samsun125
Yak Posting Veteran

63 Posts

Posted - 2009-09-21 : 03:27:49
hi all,

in my table column value is 2009-09-21 03:10:00.000 AM.

but i want to display 09/19/2009 03:10:45 AM

FOR TO GET DATE WHAT I AM DOING IS CONVERT(varchar, dbo.TBLNAME.OrderedDt, 101) AND HOW TO GET TIME WITH THIS

HOW TO DO THAT

Regards
Rama

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-09-21 : 03:32:35
can you format the datetime in your front end application ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

samsun125
Yak Posting Veteran

63 Posts

Posted - 2009-09-21 : 03:49:47
I got answer from google



select CONVERT(CHAR(8),getdate(),8)



Regards
Rama
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-22 : 03:10:28
quote:
Originally posted by samsun125

I got answer from google



select CONVERT(CHAR(8),getdate(),8)



Regards
Rama


Thats different from what you expect. Isn't it?

Madhivanan

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

- Advertisement -