Re: help with sql query
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Mon, 17 Jul 2006 13:36:36 -0400
Something like the following query ***might*** work for you.
SELECT *
FROM TABLE as T
WHERE PMDate =
(SELECT Max(PMDATE)
FROM TABLE as Temp
WHERE Temp.[Tool#] = T.[Tool#])
OR T.[Est Comp Date] =
(SELECT Min([Est Comp Date])
FROM Table as Temp2
WHERE Status = "Done" AND
Temp2.[Tool#] = T.[Tool#] AND
Temp2.[Est Comp Date] >=
(SELECT Max(PMDATE)
FROM TABLE as Temp3
WHERE Temp3.[Tool#] = Temp2.[Tool#]))
<ifoundgoldbug@xxxxxxxxx> wrote in message
news:1153156879.249940.72900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Greetings
I have a table arranged thusly
Reason Status Est Comp Date PMDate Tool#
7/14/06
WFT083
Maintence done 7/16/06 WFT083
what my sql statement MUST do is search by Tool # then find the most
recent PMDate then find if there is a work order with finished
maintence with a complete date AFTER the PMdate. also the returning
record will be a seperate record from the one with the PM date.
thanks for your help.
.
- Follow-Ups:
- Re: help with sql query
- From: ifoundgoldbug
- Re: help with sql query
- References:
- help with sql query
- From: ifoundgoldbug
- help with sql query
- Prev by Date: Re: Using Totals w/ an Updateable Recordset
- Next by Date: Re: Update Query only works first time
- Previous by thread: help with sql query
- Next by thread: Re: help with sql query
- Index(es):
Relevant Pages
|
|