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
 change time format

Author  Topic 

learning_grsql
Posting Yak Master

230 Posts

Posted - 2014-03-07 : 01:34:07

I have a time column in the below format in a table. I want to change it to "hhmm" format. How I can do that?

12:35
13:41
17:23
06:35

I want output
1235
1341
1723
0635

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-03-07 : 01:46:24
what is the data type of your column ?



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

Go to Top of Page

learning_grsql
Posting Yak Master

230 Posts

Posted - 2014-03-07 : 02:16:41
varchar
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-03-07 : 02:22:00
[code]stuff ( col , 3, 1, '' )[/code]


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

Go to Top of Page

learning_grsql
Posting Yak Master

230 Posts

Posted - 2014-03-07 : 03:43:28
thanks, is it possible to do this with any time function? I'm asking this because I may need to change this to another time format later.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2014-03-10 : 05:02:26
quote:
Originally posted by learning_grsql

thanks, is it possible to do this with any time function? I'm asking this because I may need to change this to another time format later.


It is not possible

Madhivanan

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

- Advertisement -