473,485 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query to determine if In-process jobs are behind schedule

13 New Member
Hello,
I am in the process of completley reworking an Access database that my officeuses to track progress on ongoing research projects. As part of this effort, I have created a form with a section where project milestone can be recorded. Each project can have up to 5 milestones, and each milestone has several sections.
These sections are:

Estimated Start Date
Actual start date
Estimated End Date
Actual End Date

On the form, all of these are text boxes in the Date/Time format with simple date being used. The form then populates the relevant fields on the table.

All of the estimated dates are entered when the project is originally entered into the system, and the actual dates are entered as those milestones are completed. I would like to create a query that will only pull out the records that have an estimated completion date before the current date, based on the most recent milestone.

For example, for milestone 1 the estimated start date is 03/22/2012, the actual start date is 03/24/2012, the estimated completion date is 04/12/2012, and the actual completion date is 04/12/2012 so milestone 1 has been completed. For milestone 2 the dates are 04/14/2012 for estimated start, 04/15/2012 for actual start, and estimated finish is 05/22/2012. Milestone 2 is not complete yet so it has no actual end date.

How do I set up the query so it shows that the project is behind schedule since the estimated end date is 05/22/2012, but today's date is already 6/4/2012? I want it to pull all records that fit this condition.

Sorry for the long description. Thanks for your help!
Jun 4 '12 #1
5 1817
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
In your query, you write 2 criterias. For ActualEndData you write the criteria "Is Null". This will ensure you only get the milestones that have not been completed. For EstimatedEndDate you write the criteria "<Date()" which will give you the projects that are behind schedule.

The combination of these two should fullfill your needs.
Jun 4 '12 #2
jmaher196
13 New Member
@TheSmileyCoder
I have tried to do that, but it seems to only work if all of the milestones have dates filled in. Some projects will not have all 5 milestones. I would like it to figure out if milestone 1 has been completed, then move on to milestone 2, then 3, etc. until it finds the first incomplete milestone. Any thoughts?
Jun 5 '12 #3
zmbd
5,501 Recognized Expert Moderator Expert
jmaher196:
It might help to have an idea as to how your tables are set up... If Smilie's method isn't working for you then there may be an issue with how the data is being collected and/or the underlying table structure.
-
z

ps:
following Smilies suggestion and pulling something out of thin air; your sql might look something like this using a table named "tbl_timeline" that you tracked the project histories and it might be related to another project table that had the other information:

Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_timeline.timeline_id, tbl_timeline.fk_project_id, tbl_timeline.est_startdate, tbl_timeline.est_enddate, tbl_timeline.actl_startdate, tbl_timeline.actl_enddate
  2. FROM tbl_timeline
  3. WHERE (((tbl_timeline.est_enddate)<Date()) AND ((tbl_timeline.actl_enddate) Is Null));
This will return all of the records in tbl_timeline that have no end date entered and the estimated end time is earlier than today's date... you can then group or filter on the other fields as needed...

You might also double check the level of normalization in your database... it is a stumbling block for many people (including myself - usually if I'm having issues with quries it's because of this...) a good basic explanation is at: http://bytes.com/topic/access/insigh...ble-structures

-
z
Jun 5 '12 #4
jmaher196
13 New Member
Thank you to both of you. I will work on it today and see if your suggestions work!
Jun 5 '12 #5
zmbd
5,501 Recognized Expert Moderator Expert
Opps... forgot a field in my fictional query, [Milestone]:
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_timeline.timeline_id, tbl_timeline.fk_project_id, tbl_timeline.milestone, tbl_timeline.est_startdate, tbl_timeline.est_enddate, tbl_timeline.actl_startdate, tbl_timeline.actl_enddate 
  2. FROM tbl_timeline 
  3. WHERE (((tbl_timeline.est_enddate)<Date()) AND ((tbl_timeline.actl_enddate) Is Null)); 
  4.  
Doesn't change the resulting records from the underlying table.
Jun 5 '12 #6

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

Similar topics

14
3846
by: Dave Thomas | last post by:
If I have a table set up like this: Name | VARCHAR Email | VARCHAR Age | TINYINT | NULL (Default: NULL) And I want the user to enter his or her name, email, and age - but AGE is optional. ...
1
2526
by: The Mad Russian | last post by:
I have a database that keeps track of hockey games which I work at. In one table, I have the season's schedule. I want to put together a query that has the complete schedule, but also I want each...
6
13257
by: NB | last post by:
Hi Is there any way to call up the query design view from code? In my compiled-as-MDE app everything is hidden from end users. However, I want advanced user to have access to the query design...
3
1618
by: Lea | last post by:
Having a problem with a query within a table for appointment schedules. In this table tblMeetingInfo are two fields, StartDate and EndDate. The date information is entered into each of these...
6
10716
by: Sparticus | last post by:
I have a database that isn't very big. It has about 2400 rows in it. I try and do an update like this one below (it looks big, but it's really not if you look at it) : UPDATE jobs SET...
1
2393
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
2
1660
by: Bob Sanderson | last post by:
I am using the following query to generate a web page. Searchterm is derived from a search form. $query="select * from jobs, items where jobs.JobNumber like '$Searchterm' and items.JobNumber...
4
6726
by: jafoxy | last post by:
Please help as I have a problem at work. There is a button on my form that runs a query. It all works fine except that the query results are shown behind my form instead of coming to the front. ...
3
1888
by: assgar | last post by:
Hi I am having problem with my loping. I don't know if I have chosen the correct approach. GOAL: I need to insert into a table event types for a specific date range. The calendar the event...
0
1340
by: mariasoosai | last post by:
I have to send the jobs status that are started running from the previous day 9.00 a.m to today 9 a.m from the table sysjobhistory in sql server msdb database.But in that table , date and time are...
0
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7116
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
7161
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...
1
4857
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
247
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.