Hi:
How can I force MsSQL to a explicit DateFormat.
Like: 'DD/YY'SELECT CAST(Day(getdate()) AS char(2)) + '/' + CAST(RIGHT(Year(getdate()), 2) AS char(2))|||First, you can't control they way date is stored, because it's in 2 integer format, no matter what you do. It's the output format you're talking about. And this one depends on connection and environment setting of the client. If you're talking about QA, go to Optins and enable Use Regional settings..., then go to your Regional Settings applet in Control Panel and set it the way you want.|||Because I'm "converting" PL/SQL sentencies to TSQL I was making a "traslation".
As you may know ORACLE has this:
TO_DATE('29/01/2003', 'DD/MM/YYYY')
and I thought that MSSQL had something like that.
Thanks for your response.|||'DD/YY'?
What good does that date format do?
rdjabarov is correct, but if you insist on formatting this in your SQL code then look up the CONVERT function in Books Online.
No comments:
Post a Comment