Syntax Error?

I am getting a syntax error from this sql query.  I have been looking at it for over an hour and I just don't see the error.  Can someone take a look and let me know where the error is?


SELECT
    RM00101."CUSTNMBR", RM00101."CUSTNAME", RM00101."ADDRESS1", RM00101."ADDRESS2", RM00101."CITY", RM00101."STATE", RM00101."ZIP", RM00101."PHONE1", RM00101."FAX", RM00101."SLPRSNID",
    RM14009."PN_County",
    RM00301."SPRSNSLN",
    SOP30200."SOPTYPE", SOP30200."SOPNUMBE", SOP30200."DOCDATE",
    SOP30300."ITEMNMBR", SOP30300."ITEMDESC", SOP30300."UOFM", SOP30300."QUANTITY"
FROM
    { oj (((("PION"."dbo"."RM00101" RM00101   INNER JOIN "PION"."dbo"."RM14009" RM14009 ON RM00101."ADRSCODE" = RM14009."ADRSCODE" AND RM00101."CUSTNMBR" = RM14009."CUSTNMBR")  INNER JOIN "PION"."dbo"."SOP30200" SOP30200 ON RM14009."CUSTNMBR" = SOP30200."CUSTNMBR")  INNER JOIN "PION"."dbo"."SOP30300" SOP30300 ON SOP30200."SOPTYPE" = SOP30300."SOPTYPE" AND SOP30200."SOPNUMBE" = SOP30300."SOPNUMBE" )  INNER JOIN "PION"."dbo"."RM00301" RM00301 ON RM00101."SLPRSNID" = RM00301."SLPRSNID" )   }              
WHERE
    SOP30200."DOCDATE" >= {ts '2005-03-01 08:19:37.00'} AND
    SOP30200."DOCDATE" < {ts '2005-03-31 08:19:38.00'} AND
    SOP30200."SOPTYPE" = 2 AND
    RM00101."SLPRSNID" = '04'              
ORDER BY
    RM00101."SLPRSNID" ASC
LVL 3
PioneermfgAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

g_johnsonCommented:
what back end?  do you get any more information than "syntax error"?
PioneermfgAuthor Commented:
Yes, backend is sql 2000, line 1 '}'
PockyMasterCommented:
why are you putting the curly {} around the FROM ?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

g_johnsonCommented:
i agree, get read of the brackets {}
PioneermfgAuthor Commented:
I didn't put them there, Crystal Reports did.
PioneermfgAuthor Commented:
I removed the brackets as suggested and now I get the same syntax error only now is shows the "(".
PockyMasterCommented:
Doesn't matter who did it.. but I believe they shouldnt be there .. but is it working now?
PioneermfgAuthor Commented:
I also receive a pop up window that states "error detected by database dll"
PockyMasterCommented:
well.. lets break down your query:

SELECT
    RM00101.CUSTNMBR, RM00101.CUSTNAME, RM00101.ADDRESS1, RM00101.ADDRESS2, RM00101.CITY, RM00101.STATE, RM00101.ZIP, RM00101.PHONE1, RM00101.FAX, RM00101.SLPRSNID,
    RM14009.PN_County,
    RM00301.SPRSNSLN,
    SOP30200.SOPTYPE, SOP30200.SOPNUMBE, SOP30200.DOCDATE,
    SOP30300.ITEMNMBR, SOP30300.ITEMDESC, SOP30300.UOFM, SOP30300.QUANTITY
FROM
    RM00101  
INNER JOIN RM14009 ON (RM00101.ADRSCODE = RM14009.ADRSCODE
            AND RM00101.CUSTNMBR = RM14009.CUSTNMBR)  
INNER JOIN SOP30200 ON (RM14009.CUSTNMBR = SOP30200.CUSTNMBR)  
INNER JOIN SOP30300 ON (SOP30200.SOPTYPE = SOP30300.SOPTYPE AND SOP30200.SOPNUMBE = SOP30300.SOPNUMBE )  
INNER JOIN RM00301 ON (RM00101.SLPRSNID = RM00301.SLPRSNID )
WHERE
    SOP30200.DOCDATE >= {ts '2005-03-01 08:19:37.00'} AND
    SOP30200.DOCDATE < {ts '2005-03-31 08:19:38.00'} AND
    SOP30200.SOPTYPE = 2 AND
    RM00101.SLPRSNID = '04'              
ORDER BY
    RM00101.SLPRSNID ASC

Does it work like this?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PioneermfgAuthor Commented:
No, but I receive no records nor do I receive any errors.  Let me clarify.  Before I added the rm00301.SPRSNSLN field, this query worked.
PioneermfgAuthor Commented:
PockyMaster your answer wasn't quite correct, but it did get me on the right path.  I have fixed the issue and the reports works!  Thanks!!!
PockyMasterCommented:
Good job :D
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.