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)
 I want to return Time in 16:40:15 Format

Author  Topic 

ya3mro
Starting Member

37 Posts

Posted - 2006-06-08 : 20:51:26
i store datetime in Db and i want to return only Time from this column in 15:30:10 format not 3:30:10 PM

how can i get it ??

How I Came To Islam?
http://english.islamway.com

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-08 : 21:07:45
use convert(varchar(10), date_time_col, 108)

alternatively you can do the formating in your front end application


KH

Go to Top of Page

ya3mro
Starting Member

37 Posts

Posted - 2006-06-09 : 08:40:17
but i think this is not a solution

How I Came To Islam?
http://english.islamway.com
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-09 : 08:51:09
?? khtan proived an excellent solution with convert(varchar(10), date_time_col, 108)
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-09 : 09:26:43
quote:
Originally posted by ya3mro

but i think this is not a solution

How I Came To Islam?
http://english.islamway.com



Why this is not a solution ? What's wrong with it ?


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-09 : 09:30:05
quote:
Originally posted by ya3mro

but i think this is not a solution

How I Came To Islam?
http://english.islamway.com



Yes Better do it in Front end application if you use

Madhivanan

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

- Advertisement -