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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CASE problem 1

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,038
US
Can anyone tell me what is wrong with this code? I am getting "Incorrect syntax near ')'" I don't understand this error at all.

Code:
SELECT iminvloc_sql.item_no, iminvloc_sql.loc, 
   sum(case year(trx_dt) when 2014 then quantity else 0[red])[/red] as Useage, 
   max(trx_dt) as LastUsedDate
FROM iminvloc_sql LEFT OUTER JOIN 
   iminvtrx_sql on iminvloc_sql.item_no = iminvtrx_sql.item_no 
   and iminvloc_sql.loc = iminvtrx_sql.loc
WHERE source in ('O','P','S','I')  and doc_type = 'I'
GROUP BY iminvloc_sql.item_no, iminvloc_sql.loc


Software Training, Implementation, Programming and Support for Macola Progression, Macola ES, Synergy, and Crystal Reports. Check out our Macola tools:
 
You're welcome.

This is called tunnel vision. And you did the right thing, just asking.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top