Complex Query

From: Danny Hughes <hughes_at_phyplt.umsmed.edu>
Date: 1996/04/03
Message-ID: <316307CF.440C_at_phyplt.umsmed.edu>#1/1


I need help with sql syntax for the following:

I have a table called req that has the following fields, wo_number, room, enter_date, crew, description. I am trying to get a listing of possible duplicate work orders for each room. To be considered a possible duplicate, the work orders for each room will have a start date within two weeks of each other. I can get a complete listing by room and start date order but it consist of everything and all I am interested in is only the ones that have the start date within the 2 week period.

example:
wo_number room date

wo1              100         1-10-96
wo2              200         1-10-96
wo3              200         1-15-96
wo4              200         2-15-96
wo5              300         2-16-96
wo6              300         3-10-96

in this example, the only ones I am interested in are wo2 and wo3 because they are the only ones that are within the two week period

Thanks in advance
Danny Hughes Received on Wed Apr 03 1996 - 00:00:00 CEST

Original text of this message