473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Missing inspections to dates

I have a databse which I use to show when a vehicle inspection is due on a 6 weekly and 12 weekly cycle, however if an inspection is missed I need to have some way of reminding me that an inspection has been missed, even though the current one has been done and the next inspection due is showing. bearing in mind my knowledge of access to date is limited to using the built in wizards etc. I am not entirely up to speed on sql or vba sorry.

Tony
Feb 27 '11 #1
5 1798
beacon
579 512MB
Hi Tony,

Welcome to Bytes!

You can create a query that includes all the fields from the pertinent tables and create expressions in the query that identify the date for the 6 week and 12 week cycle, and whether or not the inspection was completed by the date or not.

So, let's assume you have a field in a table called LastInspectionDate that identifies the date of the last completed (or current) inspection. Let's also assume that you have a field in the table called InspectionCompletionDate that identifies the date that the next inspection is completed. You would add both of these fields to the query.

First, create an expression that identifies the date 6 weeks from the last inspection date by using the following:
Expand|Select|Wrap|Line Numbers
  1. 6Week: =DateAdd("ww", 6, [LastInspectionDate])
  2.  
The expression above adds 6 intervals, which is weeks ("ww" is the setting for weeks) in this case, to the last inspection date.

Now, for the 12 week cycle, create another expression that is the same as the first one we just created, but change the number to 12:
Expand|Select|Wrap|Line Numbers
  1. 12Week: =DateAdd("ww", 12, [LastInspectionDate])
  2.  
Now you know the exact date for each cycle and we can create two more expressions that check to see if a date has been entered in the InspectionCompletionDate field (a date would indicate that the inspection was completed, whereas an empty field would indicate that the inspection has yet to be completed) and whether or not the current date has passed the due dates for the inspection. The expressions for these would be:
Expand|Select|Wrap|Line Numbers
  1. Missed6Week: IIf((IsNull([InspectionCompletionDate])) And (Date() > [6Week]), True, False))
  2.  
and
Expand|Select|Wrap|Line Numbers
  1. Missed12Week: IIf((IsNull([InspectionCompletionDate])) And (Date() > [12Week], True, False))
  2.  
If the value in the Missed6Week or Missed12Week is True, then the inspection hasn't been completed by the current date.

In the Criteria under the Missed6Week and Missed12Week expressions, you can type True and the query will only return those records that are past due. Actually, if you put both of these in the same query, you would probably want to type True on the Criteria line for Missed6Week and True on the Or line for the Missed12Week.

Hope this helps and good luck,
beacon
Feb 27 '11 #2
Beacon, Thank you for you prompt and swift reply it is much appreciated. The 6 and 12 weekly cycle I have been using I was at a loss as to monitoring the missed dates, so thank you very much.
Tony
Feb 28 '11 #3
I have tried to impliment your solution into my database, however, with the present structure I have it will not work. I have 2 tables, one for vehicle info, make model, reg, etc. Secoind table containing what work has been carried out linked by unitid, I have at present got over thousand vehicles and in excess of 13 thousand jobs, including inspections and servicing. The work done table contains on one date feild which is JobDate and a yes/no field as to whether that job was an inspection or not. If this is incorrect procedure then I applogise. Is it therefore possible to still search for inspections not completed on a certain date in the 6 weekly cycle, as has been my previous question. Boy I do hope this makes sense.

Tony
Feb 28 '11 #4
orangeCat
83 64KB
I agree you need a query with Form or Report that identifies Overdue and upcoming Service/Inspections.

However, if you say you can't implement the solution, then perhaps your table structures are at fault.
What tables do you have? What fields in which table?
What exactly is the issue with the proposed solution?
Feb 28 '11 #5
The table in question consists of UnitID which links to the vehicle table, JobDate whish is when the job was done, whether it is inspected or just a brake pad change, WorkDone a description of what was done, Mileage obvious one, and 2 Yes/No boxes for whether it was Serviced or Inspected.
Mar 1 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Frank | last post by:
The DB in question contains daily stock transactions keyed by ticker (symbol) and date. Unfortunately all dates do not exist for all ticker symbols. To assist the process, there are two...
1
by: Peter Bailey | last post by:
I have a student table with studentid as pk and an enrolment date field as date. I have made a qry to group on date and count the number of enrolments for a particular day. What this doesnt...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
14
by: jpr | last post by:
Friends, I have a form with four fields, date1, date2, date3 and date4. All these have all a mm/dd/yyyy format and have their source to a table. I need to add an unbound control (I will name...
0
by: Takeadoe | last post by:
First, let me say that I'm brand new to Access, so please assume I know nothing. I've got a table (210k records) of deer harvest information. Date of harvest is one of many variables in the table....
13
newnewbie
by: newnewbie | last post by:
I have an Access database that I upload a data extract intoto daily. I want to create a query that will give me a list of dates that no data can be found for. E.g. there are no records created on the...
7
by: evilcowstare via AccessMonster.com | last post by:
Hi, I have searched the forum for answers on this and to be honest as a novice I find it a bit confusing so apologies if it is simple. There are some searches that I want to apply to my database....
3
by: Alex Pavluck | last post by:
I have a date stored like this '2004 - 2006' and I use this code to get startyear and stopyear StartYear: Trim(Left(,InStr(,"-")-1)) StopYear: Trim(Right(,InStr(,"-")-1)) Is there a way to...
0
Jerry Maiapu
by: Jerry Maiapu | last post by:
I HAVE THIS Sql Query ( qrysummary) : SELECT .Salutation, ., ., IIf((WorkingDays(!!, !!))-()<0,0, (WorkingDays(!!,!!))-()) AS , IIf(IsNull(),0,) AS , .SumOfHrtMintNoAOT,
2
Jerry Maiapu
by: Jerry Maiapu | last post by:
I am trying to punch into a table a bunch of dates that fall between two given dates. When compiled,no error but when on run does not do anything..(i.e nothing in the table) Can someone figure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.