![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. Does anyone understand this??? Can anyone help?? |
#3
| |||
| |||
|
|
My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. *Does anyone understand this??? Can anyone help?? |
#4
| |||
| |||
|
|
I am a bit confused. Which table is getting too many records? *I think it is the Not Complete Table. What is the structure of that table? *Can you identify the duplicates in the table by some field or combination of fields? *If so, you could assign a no duplicates index to the table based on that fields or combination of fields. Doing so will make it impossible to have duplicates in the Not Complete Table. Or you can modify your append query. Generic example of such a query. INSERT INTO NotCompleteTable (<<List of Fields>>) SELECT <<List of Fields FROM [TheSourceTable] WHERE SomeMatchingField = ??somevalue?? AND NOT Exists (SELECT * FROM NotCompleteTable WHERE NotCompleteTable.MatchingField = [TheSourceTable].[SomeMatchingField]) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 4/1/2011 7:21 AM, Anthony wrote: My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. *Does anyone understand this??? Can anyone help??- Hide quoted text - - Show quoted text - |
#5
| |||
| |||
|
|
On Apr 1, 1:21*pm, Anthony <anthony.cl... (AT) mahr (DOT) com> wrote: My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. *Does anyone understand this??? Can anyone help?? Hi Anthony, I build a similar system. In that I do not need a Not-completed-table, because all the information is already in the Services-table. Those Services that have an empty Service Date AND Due Date <= Today still have to be completed. Imb.- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
Your correct, they do need to be performed but to show management what is NOT getting done I need to append whats left at the end of the week. Doing this with repeats but no more than the frequency/yr (if its a weekly service, every 7 days, then it should not be repeated more than 52 times. (52 wks/yr)- Hide quoted text - |
#7
| |||
| |||
|
|
On Apr 1, 9:26*am, John Spencer <JSPEN... (AT) Hilltop (DOT) umbc> wrote: I am a bit confused. Which table is getting too many records? *I think it is the Not Complete Table. What is the structure of that table? *Can you identify the duplicatesin the table by some field or combination of fields? *If so, you could assign a no duplicates index to the table based on that fields or combination of fields. Doing so will make it impossible to have duplicates in the Not CompleteTable. Or you can modify your append query. Generic example of such a query. INSERT INTO NotCompleteTable (<<List of Fields>>) SELECT <<List of Fields FROM [TheSourceTable] WHERE SomeMatchingField = ??somevalue?? AND NOT Exists (SELECT * FROM NotCompleteTable WHERE NotCompleteTable.MatchingField = [TheSourceTable].[SomeMatchingField]) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 4/1/2011 7:21 AM, Anthony wrote: My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still donot complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. *Does anyone understand this??? Can anyone help??- Hide quoted text - - Show quoted text - Correct, the table with the repeats is the "not completed table". Im doing this so I can get an idea of whats being done weekly as well as whats not being done. This info will validate the need for more hands. heres the sql for the append qry: INSERT INTO [Task Not Completed] ( ID, EQTYPE, DESCRIPTION, INSERVICE, LOCATION, SERIALNUMBER, MODELNUMBER, MANUFACTURER, WORKCENTER, ASSETTNUM, STARTUPDATE, WARRANTYDATE, LABORCOST, MATLCOST, EXPR1, SERVICEDUEDATE, SERVICEDATE, [Time], TIMETAKEN, COMPLETECHECK, EXPR2, FREQUENCY, Priority, [Service Type], TimeRemaining ) SELECT Equipment.ID, Equipment.EQTYPE, Equipment.DESCRIPTION, Equipment.INSERVICE, Equipment.LOCATION, Equipment.SERIALNUMBER, Equipment.MODELNUMBER, Equipment.MANUFACTURER, Equipment.WORKCENTER, Equipment.ASSETTNUM, Equipment.STARTUPDATE, Equipment.WARRANTYDATE, Equipment.LABORCOST, Equipment.MATLCOST, [TIME]-[TIMETAKEN] AS EXPR1, Service.SERVICEDUEDATE, Service.SERVICEDATE, Service.Time, Service.TIMETAKEN, Service.COMPLETECHECK, [SERVICEDATE]+[FREQUENCY] AS EXPR2, Service.FREQUENCY, Service.Priority, Service.[Service Type], Service.TimeRemaining FROM Equipment INNER JOIN Service ON Equipment.ID = Service.ID WHERE (((Service.COMPLETECHECK)=False) AND ((Service.Contracted)=False)) ORDER BY Service.SERVICEDUEDATE, Service.Priority;- Hide quoted text - - Show quoted text - |
#8
| |||
| |||
|
|
On Apr 1, 11:56*am, Anthony <anthony.cl... (AT) mahr (DOT) com> wrote: On Apr 1, 9:26*am, John Spencer <JSPEN... (AT) Hilltop (DOT) umbc> wrote: I am a bit confused. Which table is getting too many records? *I think it is the Not Complete Table. What is the structure of that table? *Can you identify the duplicates in the table by some field or combination of fields? *If so, you could assign a no duplicates index to the table based on that fields or combination of fields. Doing so will make it impossible to have duplicates in the Not Complete Table. Or you can modify your append query. Generic example of such a query. INSERT INTO NotCompleteTable (<<List of Fields>>) SELECT <<List of Fields FROM [TheSourceTable] WHERE SomeMatchingField = ??somevalue?? AND NOT Exists (SELECT * FROM NotCompleteTable WHERE NotCompleteTable.MatchingField = [TheSourceTable].[SomeMatchingField]) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County On 4/1/2011 7:21 AM, Anthony wrote: My Preventative Maintenance database has a table with Equipment anda table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkboxas well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. *Does anyone understand this??? Can anyone help??-Hide quoted text - - Show quoted text - Correct, the table with the repeats is the "not completed table". Im doing this so I can get an idea of whats being done weekly as well as whats not being done. This info will validate the need for more hands. heres the sql for the append qry: INSERT INTO [Task Not Completed] ( ID, EQTYPE, DESCRIPTION, INSERVICE, LOCATION, SERIALNUMBER, MODELNUMBER, MANUFACTURER, WORKCENTER, ASSETTNUM, STARTUPDATE, WARRANTYDATE, LABORCOST, MATLCOST, EXPR1, SERVICEDUEDATE, SERVICEDATE, [Time], TIMETAKEN, COMPLETECHECK, EXPR2, FREQUENCY, Priority, [Service Type], TimeRemaining ) SELECT Equipment.ID, Equipment.EQTYPE, Equipment.DESCRIPTION, Equipment.INSERVICE, Equipment.LOCATION, Equipment.SERIALNUMBER, Equipment.MODELNUMBER, Equipment.MANUFACTURER, Equipment.WORKCENTER, Equipment.ASSETTNUM, Equipment.STARTUPDATE, Equipment.WARRANTYDATE, Equipment.LABORCOST, Equipment.MATLCOST, [TIME]-[TIMETAKEN] AS EXPR1, Service.SERVICEDUEDATE, Service.SERVICEDATE, Service.Time, Service.TIMETAKEN, Service.COMPLETECHECK, [SERVICEDATE]+[FREQUENCY] AS EXPR2, Service.FREQUENCY, Service.Priority, Service.[Service Type], Service.TimeRemaining FROM Equipment INNER JOIN Service ON Equipment.ID = Service.ID WHERE (((Service.COMPLETECHECK)=False) AND ((Service.Contracted)=False)) ORDER BY Service.SERVICEDUEDATE, Service.Priority;- Hide quoted text - - Show quoted text - ok so what I did was add an autonumber "service tag" field to my services table that is indexed with no duplicates. In my qry I combined [service.service tag]&[Equipment.ID] this becomes a unique identifier. I can now run the append to not complete and it will not duplicate where the unique identifiers are alike. Unfortunatly, a week from now when this item still is not complete. it will not copy it. Sooooo what I did then is added an additional NOW() field to the combined fields but since NOW() is a date format including time... it again copies over duplicates. Is there a now function that represents a short date?- Hide quoted text - - Show quoted text - |
#9
| |||
| |||
|
|
My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what’s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don’t complete it. I send it to my “not complete table” unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. Does anyone understand this??? Can anyone help?? I understand. You have misdesigned the database, using separate |
#10
| |||
| |||
|
|
Anthony <anthony.cl... (AT) mahr (DOT) com> wrote innews:94dc8bb3-3eaa-4bfb-abcd-4a5ee38a6017 (AT) 27g2000yqv (DOT) googlegroups.com : My Preventative Maintenance database has a table with Equipment and a table with Services. The primary Key is an auto number field in the Equipment table. To add services such as oil changes, belt change etc. I enter the Equipment# as well as other info. This tabulates a list of services for each piece of equipment on my form. I added some checkboxes so the maintenance department can check off what s been done. On check it fills in Service Date Now() as well as takes a specified amount of time so I can calculate time and time taken. On exit It first runs an append qry that sends my completed items to a service history table. It then runs an update to clear the checkbox as well as taking the Service date adding a frequency to it which now becomes the Due date. And it shows back on the list due for 7 days later if the freq is 7. What I need to do is take any items NOT checked send them to an items not complete table daily. Thing is I can only account for items missed once in the freq. In other words, I have an Item due today, I don t complete it. I send it to my not complete table unfortunately tomorrow when I still do not complete the task and I run the append it will again send the item. So now I have an item that was added to my table 365 times since I append daily. This item is a weekly check so it should not show more than 52 times. *Does anyone understand this??? Can anyone help?? I understand. You have misdesigned the database, using separate tables and append queries, instead of using filtered select queries. Others (imb, Salad and John Spencer, maybe others) *have given the help you need, but you have failed to understand. Essentially, your services completed table and your Services Not complete table violate database design rules. The data is the same in all three tables, the only difference is the ServiceCompleteDate field is filled in or is null. In the case of is null, the difference between upcoming or overdue is the ServiceDueDate is <= or > date() Your database will be much more efficient if you redesign it to use the single table. When your maintenance dept clicks the complete checkbox, run an append query to copy the data (with your date changes) to the same table. When you want to see overdue service you run a select query, when you want to see upcoming service, run a different select query. To see completed service, run a different select query. -- Bob Q. PA is y I've altered my address.- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |