Jump to content

Incorrect Syntax Error When Executing Query


ready2drum
 Share

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...