tnguyen315
MIS
I have a query join from 3 tables...results on this query range from 3/1/09 to 3/1/11:
EstCode EstName EstType VioNum Date
340 EstA 10 2 3/1/09
340 EstA 10 2 5/5/09
340 EstA 10 2 6/9/10
340 EstA 10 2 12/7/10
341 EstB 11 5 3/28/10
341 EstB 11 5 12/2/10
341 EstB 11 5 2/28/11
345 EstC 10 1 3/8/10
345 EstC 10 7 3/8/10
347 EstD 8 8 5/8/10
347 EstD 8 1 5/8/10
Then now, I would like to show on the report within a date range (2 years). If any est.Code has greater than 3 times on the vioNum or if any estCode has 2 different vioNum during this range then show records on the report.
So based on the result above, the report will be showed:
EstCode EstName EstType VioNum
340 EstA 10 2
345 EstC 10 1
345 EstC 10 7
347 EstD 8 8
347 EstD 8 1
Please help with this, I'm so appreciated.
Thank you very much.
EstCode EstName EstType VioNum Date
340 EstA 10 2 3/1/09
340 EstA 10 2 5/5/09
340 EstA 10 2 6/9/10
340 EstA 10 2 12/7/10
341 EstB 11 5 3/28/10
341 EstB 11 5 12/2/10
341 EstB 11 5 2/28/11
345 EstC 10 1 3/8/10
345 EstC 10 7 3/8/10
347 EstD 8 8 5/8/10
347 EstD 8 1 5/8/10
Then now, I would like to show on the report within a date range (2 years). If any est.Code has greater than 3 times on the vioNum or if any estCode has 2 different vioNum during this range then show records on the report.
So based on the result above, the report will be showed:
EstCode EstName EstType VioNum
340 EstA 10 2
345 EstC 10 1
345 EstC 10 7
347 EstD 8 8
347 EstD 8 1
Please help with this, I'm so appreciated.
Thank you very much.