A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Scheduling PMs on Tue and Thursday instead of every five days



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2009, 03:45 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Scheduling PMs on Tue and Thursday instead of every five days

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
  #2  
Old August 12th, 2009, 03:54 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Scheduling PMs on Tue and Thursday instead of every five days

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.


"Bob Waggoner" wrote:

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

  #3  
Old August 12th, 2009, 04:38 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Scheduling PMs on Tue and Thursday instead of every five days

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" wrote:

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.


"Bob Waggoner" wrote:

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

  #4  
Old August 12th, 2009, 05:47 PM posted to microsoft.public.access.tablesdbdesign
Klatuu
external usenet poster
 
Posts: 7,074
Default Scheduling PMs on Tue and Thursday instead of every five days

You can style the Where Clause of your query to include only records for a
specific day of the week. You will most likely have to add a field to tell
which day a piece of equipment should have maintenance. Use the numeric
representation of the day where Sunday = 1 and Saturday = 7. So Tuesday
would be 3 and Thursday would be 5.


WHERE [PM_WeekDay] = Weekday(Date())


--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

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" wrote:

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.


"Bob Waggoner" wrote:

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

  #5  
Old August 12th, 2009, 06:20 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Scheduling PMs on Tue and Thursday instead of every five days

I have added two fields to my tbl76CalibEquip (table). Day1PM and Day2PM.
These are number fields. [The frequency for these specific equipIDs is
currently weekly - even though they want the PMs done on Tuesday and again on
Thursday] How do I change the query for these specific pieces of equipment
(with Day1PM and / or Day2PM days) to show them due on Tuesday (for example)
and again on Thursday? IF we need to change the frequency - or leave it
blank, or give it some other frequency, I can do that too.]

"Klatuu" wrote:

You can style the Where Clause of your query to include only records for a
specific day of the week. You will most likely have to add a field to tell
which day a piece of equipment should have maintenance. Use the numeric
representation of the day where Sunday = 1 and Saturday = 7. So Tuesday
would be 3 and Thursday would be 5.


WHERE [PM_WeekDay] = Weekday(Date())


--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

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" wrote:

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.


"Bob Waggoner" wrote:

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

  #6  
Old August 12th, 2009, 07:14 PM posted to microsoft.public.access.tablesdbdesign
Klatuu
external usenet poster
 
Posts: 7,074
Default Scheduling PMs on Tue and Thursday instead of every five days

What are the meanings of the two fields?

I would suggest a different method.
[PM_WeekDay] - The day of the week the PM is due or 0 for any day
[LastPM] - The most recent date the PM was completed
--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

I have added two fields to my tbl76CalibEquip (table). Day1PM and Day2PM.
These are number fields. [The frequency for these specific equipIDs is
currently weekly - even though they want the PMs done on Tuesday and again on
Thursday] How do I change the query for these specific pieces of equipment
(with Day1PM and / or Day2PM days) to show them due on Tuesday (for example)
and again on Thursday? IF we need to change the frequency - or leave it
blank, or give it some other frequency, I can do that too.]

"Klatuu" wrote:

You can style the Where Clause of your query to include only records for a
specific day of the week. You will most likely have to add a field to tell
which day a piece of equipment should have maintenance. Use the numeric
representation of the day where Sunday = 1 and Saturday = 7. So Tuesday
would be 3 and Thursday would be 5.


WHERE [PM_WeekDay] = Weekday(Date())


--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

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" wrote:

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.


"Bob Waggoner" wrote:

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

  #7  
Old August 19th, 2009, 07:39 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Scheduling PMs on Tue and Thursday instead of every five days

Dave,
Thank you for your suggestion. The user wants to schedule the same piece of
equipment (identified by EquipID) for greasing on Tuesday and again on
Thursday but not again until the next Tuesday and Thursday. Right now, my
code calls out LastPMDate + Frequency for all pieces of equipment. If
frequency is two days, it will call for it to be done Tuesday, Thursday,
Monday, Wednesday, Friday...etc. I need to be able to schedule certain pieces
of equipment for only Tuesday and thursday each week..


"Klatuu" wrote:

What are the meanings of the two fields?

I would suggest a different method.
[PM_WeekDay] - The day of the week the PM is due or 0 for any day
[LastPM] - The most recent date the PM was completed
--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

I have added two fields to my tbl76CalibEquip (table). Day1PM and Day2PM.
These are number fields. [The frequency for these specific equipIDs is
currently weekly - even though they want the PMs done on Tuesday and again on
Thursday] How do I change the query for these specific pieces of equipment
(with Day1PM and / or Day2PM days) to show them due on Tuesday (for example)
and again on Thursday? IF we need to change the frequency - or leave it
blank, or give it some other frequency, I can do that too.]

"Klatuu" wrote:

You can style the Where Clause of your query to include only records for a
specific day of the week. You will most likely have to add a field to tell
which day a piece of equipment should have maintenance. Use the numeric
representation of the day where Sunday = 1 and Saturday = 7. So Tuesday
would be 3 and Thursday would be 5.


WHERE [PM_WeekDay] = Weekday(Date())


--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

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" wrote:

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.


"Bob Waggoner" wrote:

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

  #8  
Old August 19th, 2009, 09:17 PM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Scheduling PMs on Tue and Thursday instead of every five days

Use following tables --
Equipment - EquipID primary key
PM - PM_ID, PM_Action (Grease_1, Grease_2, Oil_1, Tires_1, etc.) - EquipID
foreign key - Freq (multiplier of interval) - Interval (D- Daily, W-Weekly,
M-Monthly, Q- Quarterly, yyyy- Yearly), Option (S- from last scheduled, C-
from last completed)
PM_History - EquipID, PM_ID, PMSchedDate. PMDate, etc.

Query for EquipID, PM_ID, Max([PMDate]) AS LastPMDate, Max([PMSchedDate]) AS
LastPMSchedDate

Query PMSchedDate = DateAdd([Interval], [Freq], IIF([Option]="S",
[LastPMSchedDate], [LastPMDate]))

You may not want the ability to have 'Option'.

--
Build a little, test a little.


"Bob Waggoner" wrote:

Dave,
Thank you for your suggestion. The user wants to schedule the same piece of
equipment (identified by EquipID) for greasing on Tuesday and again on
Thursday but not again until the next Tuesday and Thursday. Right now, my
code calls out LastPMDate + Frequency for all pieces of equipment. If
frequency is two days, it will call for it to be done Tuesday, Thursday,
Monday, Wednesday, Friday...etc. I need to be able to schedule certain pieces
of equipment for only Tuesday and thursday each week..


"Klatuu" wrote:

What are the meanings of the two fields?

I would suggest a different method.
[PM_WeekDay] - The day of the week the PM is due or 0 for any day
[LastPM] - The most recent date the PM was completed
--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

I have added two fields to my tbl76CalibEquip (table). Day1PM and Day2PM.
These are number fields. [The frequency for these specific equipIDs is
currently weekly - even though they want the PMs done on Tuesday and again on
Thursday] How do I change the query for these specific pieces of equipment
(with Day1PM and / or Day2PM days) to show them due on Tuesday (for example)
and again on Thursday? IF we need to change the frequency - or leave it
blank, or give it some other frequency, I can do that too.]

"Klatuu" wrote:

You can style the Where Clause of your query to include only records for a
specific day of the week. You will most likely have to add a field to tell
which day a piece of equipment should have maintenance. Use the numeric
representation of the day where Sunday = 1 and Saturday = 7. So Tuesday
would be 3 and Thursday would be 5.


WHERE [PM_WeekDay] = Weekday(Date())


--
Dave Hargis, Microsoft Access MVP


"Bob Waggoner" wrote:

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" wrote:

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.


"Bob Waggoner" wrote:

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

  #9  
Old September 4th, 2009, 06:13 PM posted to microsoft.public.access.tablesdbdesign
Bruce Meneghin
external usenet poster
 
Posts: 119
Default Scheduling PMs on Tue and Thursday instead of every five days

Can I suggest a more generalized method of storing your "maintenance event"
rules.
You can have a table that stores the maintenance information:
fieldName example
ID 1
Frequency weekly
monthName null
dayName Tuesday
number null
eventName tuesday lube
beginDate 1/1/1900
endDate 1/1/2999
skip null

This table can store any type of recurring event like check tire pressure on
third Tues. of each month. I can send you a table with examples that shows
all variations.

So, you enter your PM events in this table; you would have a record for the
Tues. maint. and one for the Thurs. maint.

Then you can have an association table that assigns one or more PM events to
each piece of equipment.

Then you have some code that generates a calendar of PM events; this can be
done by date or by equipment. I can send you the code.


"Bob Waggoner" wrote:

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

  #10  
Old September 21st, 2009, 05:14 AM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Scheduling PMs on Tue and Thursday instead of every five days

Bruce,
I would welcome your help. Thank you. Please send code/examples.
Bob

"Bruce Meneghin" wrote:

Can I suggest a more generalized method of storing your "maintenance event"
rules.
You can have a table that stores the maintenance information:
fieldName example
ID 1
Frequency weekly
monthName null
dayName Tuesday
number null
eventName tuesday lube
beginDate 1/1/1900
endDate 1/1/2999
skip null

This table can store any type of recurring event like check tire pressure on
third Tues. of each month. I can send you a table with examples that shows
all variations.

So, you enter your PM events in this table; you would have a record for the
Tues. maint. and one for the Thurs. maint.

Then you can have an association table that assigns one or more PM events to
each piece of equipment.

Then you have some code that generates a calendar of PM events; this can be
done by date or by equipment. I can send you the code.


"Bob Waggoner" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.