var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: using convert function for date in transact sql
Is there any one know how to use CONVERT function in TSQL to convert the datetime field into the following format.
Depending on how picky you are, you might prefer:
SELECT Replace(Convert(CHAR(19), GetDate(), 120), '-', '/')
Sorry, but I get the following error message:-
120 is not a valid style number when converting from DATETIME to a character string.
????? what version of sql server?
i use 120 all the time, it's my favourite, it's the ISO standard
I'm using Sybase 12.5.1.
sorry, i keep forgetting that there are actually two completely different databases, both coincidentally called sql server
you're right, sybase's does not apeear to supoprt style 120
note that only two styles include the time
Do you mean I have no way to convert a datetime into the following format:-
please, the name is Rudy -- "Ruby" once is a typo, twice is an error
yes, you can get the format you want, but it may take several functions
do you have a manual?
I manage to do it with the following:-
SELECT Convert(CHAR(10), GetDate(), 111)+' '+Convert(CHAR(8),GetDate(),108)
Thanks a lot !!!!