Multitable select with two seperate search criteria.
Posted in 1997
Topics: General Discussion
table1 = Itemlink (serial) DollarAmt (float) table2 = Date (Date) Detaillink (serial) [Corresponds to Itemlink] Accode (char) table3 = Accode (char) Address (char) This is an oversimplification, but will do for the purposes of my question. Itemlink is a nonunique number and can have multiple entries in table1. Detaillink is unique in table two. What I want to do is get the sum of all the DollarAmt by account for two distinct ranges of date, compare them, and output the results of the comparison. Or more definitively: Produce a report, sorted by account, summing all dollar activity for week1, and week2; comparing all of the totals and producing a third value for percentage change, and then output the results in a column format listing Accode, address, week1, week2, %change Seeing as how I only have the runtime of SQL, and no compiled language, it must be done using isqlrf, biff, awk, csh, sh, etc... My first few attempts have yielded promising results, but I can't seem to make awk process all of those rows, and I'm pretty sure there must be an easier way of accomplishing this using ISQL... -- Don Mac Phee | We're here to chew bubblegum and kick ass... Systems Manager | and we seem to be all out of bubblegum. Crown Optical | Old .sigs never die.... they just fade away.... *blip* Greenville, RI | If you want my employer's opinion, ask him.