in reply to Perl DBI Error
select left(B.B_num,3) as JD, sum(B.B_COUNT) as Doc_Cnt, P.PROJECTED_VOL as Proj_Vol, P.DD_RECD as DD_Recd, P.JD_CURRENT as JD_Current, P.JD_FUTURE as JD_Future from batches as B left join projectedvolume as P on (P.REPORT_IMPORT_DT = B.REPORT_IMPORT_DT) where B.REPORT_IMPORT_DT = '2005-10-12' group by left(b_num,3)
I don't know if this will work, but I'm pretty sure you have to have "as" to tell it you want to refer to the batches table as B and the projectedvolumn as P. The On clause generally should be enclosed in () although I'm not sure that is a requirement.
|
|---|