DATE Format question

  • Hi everyone,

    i have a SQL script below

    SELECT ITEM AS "ClassCode",

    Appdate AS "EstablishedDate",

    --> output is for example : 1/1/2008 (without any single or double quotes)

    However, according to the new format, i convert it to

    SELECT ITEM AS "ClassCode"

    TO_char(Appdate,'YYYY-MM-DD') AS "EstablishedDate"

    --> output is for example : "2008-01-01" (This is what they want)--> how can i remove those double quote from script? or can i covert it to numeric value? Thank you.

  • What do you mean "remove the double quote from the script"? Also to_char() is an oracle function IIRC. Are you asking what the SQL Server equivalent is?

    Executive Junior Cowboy Developer, Esq.[/url]

  • Sorry for confusion.

    My company is using Toad which is from Oracle.

    TO_char(Appdate,'YYYY-MM-DD')) AS "EstablishedDate"

    when i used this function, in database there is no quote at all. However, i need to general the file to txt and pvoide to related department and the date is surrounded by " " sign.

    thanks.

  • Unfortunately I don't know the answer then. This forum is specifically for SQL Server, not Oracle, so you might have better luck on an Oracle forum.

    Executive Junior Cowboy Developer, Esq.[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply