Wow! I should've posted this sooner. This is sooooooo slick..... Shows to go you I should study SQL more. Thanks Larry :)
> -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Lawrence > Lustig > Sent: Wednesday, February 16, 2005 11:15 AM > To: RBG7-L Mailing List > Subject: [RBG7-L] - Re: Auditing Records > > Try this: > > SELECT carrier, origination_3, destination_3, service_dt, COUNT(*) AS > HowMany + > FROM AuditTrucks WHERE invoice_id IN + > (SELECT invoice_id IN d_inbox WHERE inbox_state IN (2,4)) + > GROUP BY Carrier, Origination_3, Destination_3, Service_DT + > HAVING COUNT(*) > 1 > > Should give you what you want with no cursors, temporary tables, projects, > etc. > If it does what you want, convert it to a view called AuditTruckDups and > you > can base reports on it, etc. > -- > Larry
