I could write this in a cursor or .net and loop thru this but I am thinking there has to be a simpler way to do this.
Here is my info:
--Do as .net reader with this
--for Each element in reader
select iv30400.serltnum, iv30300.trnstloc, iv30300.docdate
join iv30300 on (iv30400.ivdoctyp = iv30300.doctype and iv30400.docnumbr = iv30300.docnumbr)
where iv30400.serltnum = rs.serlnmbr -- FROM RECORDSET ABOVE
and iv30300.trnstloc = rs.locncode -- FROM RECORDSET ABOVE
and iv30300.docdate < '5/6/11' -- More than 7 days, I can do this, a dateadd -7, etc...
can i just write one query and do this? thanks.