Results 1 to 5 of 5

Thread: can anyone help plz...

  1. #1
    Join Date
    Dec 2007
    Posts
    13

    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.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Is it on sql server? If so, datecolumn should be datetime type or have string like '11/03/2007'.

  3. #3
    Join Date
    Dec 2007
    Posts
    13
    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.....

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    Try with case instead of month function.

  5. #5
    Join Date
    Dec 2007
    Posts
    13
    thanx for ur response...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •