Friday, March 30, 2012

Need to convert Date from "YYYY-MM-DD 00:00:00.0000" to "MM/DD

select substring(CONVERT(CHAR(8), date, 112), 5,2) + '/'
+ substring(CONVERT(CHAR(8), date, 112), 7,2) + '/'
+ substring(CONVERT(CHAR(8), date, 112), 1,4)
from table
Archer
"Trey Walpole" wrote:

> in addition to the other comments - you could simply change the boss's
> spreadsheet column to display date format. :)
> Robert G via webservertalk.com wrote:
>
>or just
select convert(varchar,date,101)
from table
:)
bagman3rd wrote:
>select substring(CONVERT(CHAR(8), date, 112), 5,2) + '/'
>+ substring(CONVERT(CHAR(8), date, 112), 7,2) + '/'
>+ substring(CONVERT(CHAR(8), date, 112), 1,4)
>from table
>Archer
>"Trey Walpole" wrote:
>
>

No comments:

Post a Comment