It's an Access question. Sorry for not being clear on that. This is the query
that sources the PM due report (7 days due).
Table 1: tbl76CalibEquipTable - uses EquipID (txt) as key. It describes the
equipment.
Table 2: tbl76PMs - uses PMID (LI) as key. FK is EquipID.
Frequency of PMs is assigned by days
MaxofDateDone is a query that shows the last PM for each equipID.
Currently: In a field in the tbl76CalibEquip I use a foreign key ID that
matches the number of days in the frequencyID field (LI) that draws the
number of days from tbl76PMFrequency.
SELECT Format$(([MaxOfDateDone]+[FreqDays]),"mmm yyyy") AS Expr1,
(([MaxOfDateDone]+[FreqDays])) AS Expr2, tbl76PMs.DateDone,
tbl76PMs.MaintType, tbl76PMFrequency.FreqID, tbl76CalibEquipment.Category,
tbl76CalibEquipment.Description, tbl76CalibEquipment.Location,
tbl76CalibEquipment.SerialNumber, tbl76CalibEquipment.ModelNo,
tbl76PMFrequency.Frequency, tbl76PMFrequency.FreqDescription,
tbl76PMFrequency.FreqDays, tbl76CalibEquipment.[OutsideCalib?],
tbl76CalibEquipment.AssetTagID, [tbl76CalibEquipment]![EquipID] & " " &
[Description] AS Expr3, [Location] & " Model# " & [ModelNo] & " Serial#
" & [SerialNumber] AS Expr4, IIf(Weekday([MaxOfDateDone]+[FreqDays]) Between
2 And 6,[MaxOfDateDone]+[FreqDays],IIf(Weekday([MaxOfDateDone]+[FreqDays]+1)
Between 2 And 6,[MaxOfDateDone]+[FreqDays]+1,[MaxOfDateDone]+[FreqDays]+2))
AS Expr5
FROM (tbl76CalibEquipment INNER JOIN tbl76PMFrequency ON
tbl76CalibEquipment.Frequency = tbl76PMFrequency.Frequency) INNER JOIN
(qry76PMsLastDone INNER JOIN tbl76PMs ON (tbl76PMs.EquipID =
qry76PMsLastDone.EquipID) AND (qry76PMsLastDone.MaxOfDateDone =
tbl76PMs.DateDone)) ON tbl76CalibEquipment.EquipID = tbl76PMs.EquipID
WHERE ((((([MaxOfDateDone]+[FreqDays])))<=Date()+7) AND
((tbl76PMs.MaintType) Not Like "n*") AND ((tbl76CalibEquipment.MaintType) Not
Like "N/A"))
ORDER BY (([MaxOfDateDone]+[FreqDays])), tbl76PMFrequency.FreqID;
KARL DEWEY said:
Is this an Outlook or Access question?
If it is Access then post your table structure with field names and
datatype, and sample data.
--
Build a little, test a little.
:
My database is set up to remind maintenance of PMS due based on the last done
date. Now maintenance is asking for specific equipment to be PM'd on Tuesday
and Thursday (greased). I know Outlook allows you to schedule activities on a
recurring basis and you can pick the day(s) of the week that they recur. Can
anyone help me do that? I have no idea where to begin with that code/form/etc.
Thanks so much for your help.
Bob