Link to home
Start Free TrialLog in
Avatar of ayeen
ayeenFlag for United States of America

asked on

how to convert this Oracle sql statement to that of MS SQL

i'm not very versed on SQL server...can someone help me convert the sql statement below to something that MS SQL server would understand? right now im using Oracle.....

select my_table.*, my_doc_search.doc_type from my_table, my_doc_search where my_table.idx_id=my_doc_search.doc_id and (( TRUNC(my_table.invoice_date,'DD') <> TO_DATE('2008-01-28','YYYY-MM-DD') ) ) order by my_doc_search.doc_type

thanks in advance...
ASKER CERTIFIED SOLUTION
Avatar of JimFive
JimFive
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ayeen

ASKER

hi JimFive thanks for replying....

may i know what the "112" is for?

thanks!
112 indicates the date format of yyyymmdd
anything over 100 indicates to include the century. The remaining numbers indicate which date format to use. If you have SQL Server Books online installed you can look up CONVERT to get the list of codes.

I used 112 because it is the ISO standard format and there doesn't seem to be a code for yyyy-mm-dd that doesn't include the time.
--
JimFive