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 2008 Forums
 Transact-SQL (2008)
 Change format date

Author  Topic 

amsad
Starting Member

17 Posts

Posted - 2011-02-18 : 02:06:36
Hi guys,

Need your help in sql to change this format day column;

example;

no_id | Start_date_time | End_date_time |
1 2011-02-14 05:21:50.000 2011-02-15 00:35:17.000

The input need like this;

no_id | Start_date_time | End_date_time |
1 20110214 20110215


Any suggestion?

Thank you,


Can do.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-02-18 : 02:08:29
can you do this in your front end application ?


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

Go to Top of Page

amsad
Starting Member

17 Posts

Posted - 2011-02-18 : 02:15:44
i try this before, but it failed.it that any possibilities to convert this date
to become like that?

Can do.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-02-18 : 02:29:57
quote:
but it failed

What do you mean it failed ?

You can do it in sql using the convert() with style 112


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

Go to Top of Page

amsad
Starting Member

17 Posts

Posted - 2011-02-18 : 02:48:53
Thanks Khtan,

its done with style 112.





Can do.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-02-18 : 10:17:19
quote:
Originally posted by amsad

i try this before, but it failed.it that any possibilities to convert this date
to become like that?

Can do.


What error you got in front end application?

Madhivanan

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

- Advertisement -