-
can anyone help plz...
i have a column named datecolumn varchar (5). it contains data something like this:
datecolumn
26NOV
09DEC
18NOV
22DEC
now i want to make that data as this format :
26/11/
09/12/
18/11/
22/12/
i am trying to do in this way---
select substring(datecolumn,1,2)+ '/'+replace(datecolumn,substring (datecolumn,3,3),month(datecolumn))+'/' from temp_table
i am getting this error--
Syntax error converting datetime from character string.
-
Is it on sql server? If so, datecolumn should be datetime type or have string like '11/03/2007'.
-
yes it is on sql server 2000 only.
and the datatype for datecolumn is varchar (5)...
so is thr anyway tht i can get the data in the format which i have mentioned.....
-
Try with case instead of month function.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|