SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 change time format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

learning_grsql
Posting Yak Master

230 Posts

Posted - 03/07/2014 :  01:34:07  Show Profile  Reply with Quote

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)

Singapore
17681 Posts

Posted - 03/07/2014 :  01:46:24  Show Profile  Reply with Quote
what is the data type of your column ?



KH
Time is always against us


Edited by - khtan on 03/07/2014 01:46:38
Go to Top of Page

learning_grsql
Posting Yak Master

230 Posts

Posted - 03/07/2014 :  02:16:41  Show Profile  Reply with Quote
varchar
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17681 Posts

Posted - 03/07/2014 :  02:22:00  Show Profile  Reply with Quote
stuff ( col , 3, 1, '' )



KH
Time is always against us

Go to Top of Page

learning_grsql
Posting Yak Master

230 Posts

Posted - 03/07/2014 :  03:43:28  Show Profile  Reply with Quote
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

India
22769 Posts

Posted - 03/10/2014 :  05:02:26  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000