Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 11th, 2004, 11:36 PM
covah01 covah01 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 covah01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Count record given conditions;save back to table

Hello all,

I'm working with a multi-user front-end/back-end relational database. I'm trying to use VBA to count records given specific criteria, and have the value saved back to a table (whose only function is to store these values). Simplified description:
One table holds personnel data for multiple companies (name, company, etc) and a second holds training data, linked on unique field.
Conditions for count are:

SELECT Table1.Name, Table1.Company, Table1.record_valid, Table2.training_variable
FROM Table1 INNER JOIN Table2 ON Table1.Unique_ID = Table2.Unique_ID
WHERE (((Table1.Company)=[criteria]) AND ((Table1.record_valid)=Yes) AND ((Table2.training_variable)<=Date()-410 Or (Table2.training_variable) Is Null));

While the query above works, it's not flexible enough; the code will need to return multiple counts, as there are 17 different training requirements. I need to simply count the number of people requiring each training and pass them back to a table. I'm trying to avoid running 17 queries...

The process defines currency as annual + 45 days; this should give a count of anyone for whom more than 410 days have passed, PLUS those who have no dates listed at all. In addition, certain employees' records are maintained after they depart the company, so the recordset must contain only valid employees of the given company (criteria).

Since I know how fun (!) it can be to try to "virtually" work things out without having actual data with which to work, here's something like what a result should be given conditions:
If there are 5000 total records, with 600 of them being in the correct company, and 100 of those being "non current employees", the total number of records being compared will be 500. If 300 of these have had the training in the last 410 days, and 100 people have NO date listed at all, the end count should be 200 (100 overdue and 100 Null values). Sorry for the long post; hope this makes sense...and thanks in advance.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Count record given conditions;save back to table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT