ShadowMage Posted May 26, 2010 Share Posted May 26, 2010 Hey guys, I need your help again. I've got a query I put together and it's throwing an error at me. Here's what I get:Warning: odbc_exec() [function.odbc-exec]: SQL error: [DataDirect-Technologies][ODBC PROGRESS driver][PROGRESS]Syntax error (7587), SQL state 37000 in SQLExecDirect in c:\Inetpub\phplib\ODBC.php on line 229Error! Couldn't Run Query:SELECT JobOper.JobNum, JobOper.OpCode, (JobOper.EstProdHours + JobOper.EstSetHours) AS 'EstHours', (JobOper.ActProdHours + JobOper.ActSetupHours) AS 'ActHours', CASE(JobOper.EstProdHours + JobOper.EstSetHours) WHEN 0 THEN 0 ELSE(((JobOper.ActProdHours + JobOper.ActSetupHours) / (JobOper.EstProdHours + JobOper.EstSetHours)) * 100) END AS 'Percentage' WHERE ((JobOper.JobNum LIKE 'e%') AND (JobOper.JobComplete <> 0) AND ((JobOper.OpCode = 'PSub') OR (JobOper.OpCode = 'PProd') OR (JobOper.OpCode = 'CkAll'))) ORDER BY JobOper.JobNum ASC, JopOper.OpCode ASCError Message: [DataDirect-Technologies][ODBC PROGRESS driver][PROGRESS]Syntax error (7587)Now I've looked at this thing, and I can't for the life of me see where there's a syntax error. It could be something with my CASE statements since I've never used them before. I've checked all the table names and field names, checked my parens, checked my logic operators, and it all seems to check out. Is there something wrong with the CASE or my arithmetic operators? Link to comment Share on other sites More sharing options...
justsomeguy Posted May 26, 2010 Share Posted May 26, 2010 ORDER BY JobOper.JobNum ASC, JopOper.OpCode ASCDoes it matter that there's no FROM? I'm not familiar with Progress. Link to comment Share on other sites More sharing options...
ShadowMage Posted May 27, 2010 Author Share Posted May 27, 2010 ORDER BY JobOper.JobNum ASC, JopOper.OpCode ASCDoes it matter that there's no FROM? I'm not familiar with Progress.Wow. Can't believe I missed the FROM.... You wouldn't believe how long I stared at that, and how many times I went through that query, and I still missed the fact that I didn't have a FROM.Thank you, JSG.BTW, thanks for pointing out my spelling mistake, too. Though I think the missing FROM is the error it was throwing at me. It never even got down to my typo. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.