CustomCode
New member
- Local time
- Today, 10:31
- Joined
- Jul 9, 2003
- Messages
- 7
Hi I have a query that takes current kilometers and compares it with the next dry service and wet service kilometers. The query is set so the vehicle does not show on the report till it is due for a service.
The query works the same way by date. If the current date is equal or greater then the Dry or Wet date the unit will show up on the report.
It runs for seperate divisions and checks the status of the unit. If the unit is sold it will not show up for a service or safety.
Here is the problem:
NextSerType is a column that is suppose to say either Wet, Dry, CVI Inspection, Reefer Service or combination if a CVI and service are due.
It does not update the NextSerType in the query or the database
Here is the code
SELECT [Assets].AssetID, Departments.DepartmentName, [Assets].NextDryDate, [Assets].NextWetDate, [Assets].NextSerType, [Assets].CurrentOdo, [Assets].NextDryOdo, [Assets].NextWetOdo, [Assets].NextReefer, [Assets].CVIDate, [Assets].StatusID
FROM [Assets] INNER JOIN Departments ON [Assets].DepartmentID = Departments.DepartmentID
WHERE (((Departments.DepartmentName)="4" Or (Departments.DepartmentName)="44" Or (Departments.DepartmentName)="45" Or (Departments.DepartmentName)="48") AND (([Assets].StatusID)=1 Or ([Assets].StatusID)=5 Or ([Assets].StatusID)=6 Or ([Assets].StatusID)=7 Or ([Assets].StatusID)=8 Or ([Assets].StatusID)=9 Or ([Assets].StatusID)=10 Or ([Assets].StatusID)=11 Or ([Assets].StatusID)=12 Or ([Assets].StatusID)=13 Or ([Assets].StatusID)=14 Or ([Assets].StatusID)=15 Or ([Assets].StatusID)=16 Or ([Assets].StatusID)=17 Or ([Assets].StatusID)=18 Or ([Assets].StatusID)=19 Or ([Assets].StatusID)=20 Or ([Assets].StatusID)=21 Or ([Assets].StatusID)=22 Or ([Assets].StatusID)=24 Or ([Assets].StatusID)=25 Or ([Assets].StatusID)=27 Or ([Assets].StatusID)=29 Or ([Assets].StatusID)=30 Or ([Assets].StatusID)=31))
ORDER BY [Assets].NextDryDate;
Thx in advance
The query works the same way by date. If the current date is equal or greater then the Dry or Wet date the unit will show up on the report.
It runs for seperate divisions and checks the status of the unit. If the unit is sold it will not show up for a service or safety.
Here is the problem:
NextSerType is a column that is suppose to say either Wet, Dry, CVI Inspection, Reefer Service or combination if a CVI and service are due.
It does not update the NextSerType in the query or the database
Here is the code
SELECT [Assets].AssetID, Departments.DepartmentName, [Assets].NextDryDate, [Assets].NextWetDate, [Assets].NextSerType, [Assets].CurrentOdo, [Assets].NextDryOdo, [Assets].NextWetOdo, [Assets].NextReefer, [Assets].CVIDate, [Assets].StatusID
FROM [Assets] INNER JOIN Departments ON [Assets].DepartmentID = Departments.DepartmentID
WHERE (((Departments.DepartmentName)="4" Or (Departments.DepartmentName)="44" Or (Departments.DepartmentName)="45" Or (Departments.DepartmentName)="48") AND (([Assets].StatusID)=1 Or ([Assets].StatusID)=5 Or ([Assets].StatusID)=6 Or ([Assets].StatusID)=7 Or ([Assets].StatusID)=8 Or ([Assets].StatusID)=9 Or ([Assets].StatusID)=10 Or ([Assets].StatusID)=11 Or ([Assets].StatusID)=12 Or ([Assets].StatusID)=13 Or ([Assets].StatusID)=14 Or ([Assets].StatusID)=15 Or ([Assets].StatusID)=16 Or ([Assets].StatusID)=17 Or ([Assets].StatusID)=18 Or ([Assets].StatusID)=19 Or ([Assets].StatusID)=20 Or ([Assets].StatusID)=21 Or ([Assets].StatusID)=22 Or ([Assets].StatusID)=24 Or ([Assets].StatusID)=25 Or ([Assets].StatusID)=27 Or ([Assets].StatusID)=29 Or ([Assets].StatusID)=30 Or ([Assets].StatusID)=31))
ORDER BY [Assets].NextDryDate;
Thx in advance