Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Expression generating error for unknown reason

Status
Not open for further replies.

majordog

Programmer
Jul 8, 2002
222
CA
Hi All,

I'm writing an SQL Expression Field and and receiving error:

ODBC error: [Microsoft][ODBC Microsoft Access Driver] Syntax error. in query expression 'Select Gas_Types.'Acronym'

The query below works in Access 2000, which is the same oe that I have plugged into Crystal 8.5, some differences exist only in the representation like Gas_Types.Acronym looks like Gas_Types.`Acronym` in Crystal. The error message leads me to believe that Crystal can't find the table, yet, SElect statement below was written directly in Crystal datasource - Why could Access see it and not crystal. Syntax error was my final conclusion, but I don't know what Crystal requires that I am not providing. If anybody could help me I would appreciate it. I provided the Select statement just FYI.
Thanks IN Advance!

SELECT Gas_Types.Acronym, Phase_Results.[Phase Number]
FROM ((Gas_Types INNER JOIN Instruments ON Gas_Types.GasID = Instruments.[Gas Type]) INNER JOIN Instrument_Locations ON Instruments.InstID = Instrument_Locations.Instrument) INNER JOIN (Instrument_Ranges INNER JOIN TestCell_Instruments ON Instrument_Ranges.Inst_Range_ID = TestCell_Instruments.Inst_Range_ID) ON Instruments.InstID = Instrument_Ranges.Instrument, Test_Results INNER JOIN (Phase_Results INNER JOIN Emission_Results ON Phase_Results.PhaseID = Emission_Results.PhaseID) ON Test_Results.TestID = Phase_Results.TestID
WHERE Emission_Results.`Cell_Range` = TestCell_Instruments.`Cell_Range` AND Emission_Results.`Compound_Number` =TestCell_Instruments.`Compound_Number` AND Test_Results.`DatePerformed` >= TestCell_Instruments.`InserviceDate`



 
You can't paste MS Access SQL into Crystal 8.5.

A SQL Expression isn't used to create select statements, they're like formulas, except that they are written in a Structured Query Language.

I think that you may misunderstand how to obtain data via Crystal 8.5 and below.

Probably the easiest thing is if that SQL works in MS Access, create a MS Access Query and use that as your data source in Crystal.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top