Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Crystal Reports & Met/Track Post Reply Post New Topic
Author Message
dizzyjer
Newbie
Newbie
Avatar

Joined: 04 Aug 2011
Location: United States
Online Status: Offline
Posts: 1
Quote dizzyjer Replybullet Topic: Crystal Reports & Met/Track
     Posted: 04 Aug 2011 at 7:33am
Is there anyone out there that can tell me how to write an SQL Expression within a report that is connected to a Fluke Met/Track Database?
 
I took this SQL from a subreport and pasted it into an SQL Expression

 SELECT "Calibration"."MTAG", "Calibration"."C2323", "Calibration"."C2301"
 FROM   "mt"."Calibration" "Calibration"
 WHERE  "Calibration"."MTAG"='221287:1240867615' AND "Calibration"."C2323"='n' AND "Calibration"."C2301"<={d '2011-08-04'}
 
and received this error:
 
Error in compiling SQL Expression: Query Engine Error: '42000:[Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error or access violation: near 'SELECT' in ... [SELECT] "Calibration"."...'.
 
Any ideas?
I woke up for this...
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Aug 2011 at 9:12am
You can't run a Select statement in a SQL Expression.  SQL Expressions are used to bring in extra data as part of your report - anything that can be set up as a "field" in a result set can be an expression.  For example, I have used SQL Expressions that call a function that translates a User ID to a Name or that concatenates multiple fields into an address in a specific format.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum