Add Command button not present and SQL Expression syntax error

  • Thread starter Thread starter richardkreidl
  • Start date Start date
R

richardkreidl

Two questions, first I'm using CR 10 and connecting to a Sybase
database. I don't see a 'Add Command' button in the 'Database Expert'
dialog.

Second is how would I correctly code the syntax for the following SQL
code in the SQL expression editor:

SELECT JobNam, JobFailInstrTxt
FROM SchedUNIXJob, ApplicationCdeVal
WHERE ApplicationCdeVal.ApplicationTxt = "dailyops"
AND SchedUNIXJob.ApplicationCde = ApplicationCdeVal.ApplicationCde
GROUP BY SchedUNIXJob.JobNam

I've tried single and double quotes, but no luck I always get a syntax
error. I've even read where you should enclose the whole SQL statement
in paranetheses.


I'd appreciate any help with these two???
 
SELECT JobNam, JobFailInstrTxt
FROM SchedUNIXJob, ApplicationCdeVal
WHERE ApplicationCdeVal.ApplicationTxt = "dailyops"
AND SchedUNIXJob.ApplicationCde = ApplicationCdeVal.ApplicationCde
GROUP BY SchedUNIXJob.JobNam

I've tried single and double quotes, but no luck I always get a syntax
error. I've even read where you should enclose the whole SQL statement
in paranetheses.

I think you should use single quotes in the WHERE clause, but your
syntax error may be caused by the GROUP BY. The GROUP BY must include
all non-aggregate columns that are in the SELECT list. That means you
must include the JobFailInstrTxt in the GROUP BY since it is a non
aggregate column.
 
Back
Top