Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a shorter syntax?
Message
From
23/05/2001 23:51:35
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00510693
Message ID:
00510721
Views:
16
This message has been marked as the solution to the initial question of the thread.
>It doesn't work because I have to CAST to be able to concatenate the / (and the cast erase the 0).


OK... let's try again. This works for me:
SELECT convert(char(7),convert(datetime,TB.Date),111)
...
It returns yyyy/mm (i.e. '2001/05')
Hope it works for you.
Andres M. Chiriboga, MCSE, MCP+I
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform