We help IT Professionals succeed at work.

SSIS, Date Format

I was wondering if someone could help me change the result of this expression
from yyyy-mm-dd to mm-dd-yyyy.

(DT_STR,20,1252)(SUBSTRING((DT_STR,10,1252)Jdate,1,1) == "1" ? "20" : "19") + SUBSTRING((DT_STR,10,1252)Jdate,2,2) + "-01-01"

Thanks
Comment
Watch Question

Commented:
you can do it with convert function
select (convert(varchar(10),@date,110))

Author

Commented:
That would normally be true but in this case I dont have that opportunity due to the flow of the
data transform.

See case:  http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL_Server_2008/Q_27345890.html

I just want to rearrange this formula.  So that the month and day come first.

(DT_STR,20,1252)(SUBSTRING((DT_STR,10,1252)Jdate,1,1) == "1" ? "20" : "19") + SUBSTRING((DT_STR,10,1252)Jdate,2,2) + "-01-01"

Author

Commented:
When your right your right.  The date in sql server will always be stored yyyy-mm-dd

So the format of the date can be dealt with on the select.