ready2drum Posted August 31, 2009 Share Posted August 31, 2009 I created a query using Toad for Oracle 9.0.1, and it executed without errors. I was able to use the SQL button to save it as a file and export it as an .XLS spreadsheet. I then opened the file using SQL Server Mgmt Studio 2005, and clicked on the 'parse' button, which was successful, however, when I clicked on the 'execute' icon, the following error appeared....Msg 156, Level 15, State 1, Line 9Incorrect syntax near the keyword 'AND'.I know it's a Monday, but the code appears to be fine to me...so now I'm relying on an outside pair of eyes to help me resolve this error...Here's what the code looks like below: SELECT tidapmst.created_by, tidapmst.create_date, tidapmst.invoice_no, tidapmst.invoice_date, tidapmst.vendor_code, tidapmst.facility FROM cb10.tidapmst WHERE ((tidapmst.invoice_date BETWEEN '20090701' AND '20090731')) AND ((tidapmst.facility = 'BIG')) AND ((tidapmst.created_by <> 'APBAK')) AND ((tidapmst.created_by <> 'ADASCO'))ORDER BY tidapmst.created_by ASC AND tidapmst.created_date ASC I appreciate your help and guidance on this simple dilemma.Thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted August 31, 2009 Share Posted August 31, 2009 I don't use Oracle, but ORDER BY typically doesn't use AND, it's just comma-separated. Link to comment Share on other sites More sharing options...
ready2drum Posted August 31, 2009 Author Share Posted August 31, 2009 I don't use Oracle, but ORDER BY typically doesn't use AND, it's just comma-separated.Oh okay...thanks for letting me know. I'll modify the code and run it through SQL again. If for some reason it doesn't work, I'll reply back.Thanks for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.