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 January 21st, 2004, 09:06 PM
Mouse Mouse is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Alaska
Posts: 3 Mouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Excluding records based on date

I'm a network admin type and not exactly a SQL guru though I know the basics. What I'm trying to accomplish is that I have a program that checks my ~1500 computers for MS patches, virus def date, or other tasks I push out and logs the results to a csv. The program runs in the background via login script.

My log generates something like this:
computername, username, date/time, task, task, task

I can import this to access and would like to generate a report on demand of when the last log for each computer was added and it's status.

I'm trying to just get the latest entry to the log. I've tried the MAX aggregate funtion on the date/time field but still get multiple returns as the username or status of tasks has changed. I've tried DISTINCT on the computername field but get multiples due to multiple runs.

I though I had something going by creating an self-join (per access help: adding the table twice, renaming one and trying to use criteria in the date field of: Log.date=MAX(Copy.date) but I get a 'can't use aggregate function in WHERE clause' error. Any other suggestions?

Reply With Quote
  #2  
Old January 21st, 2004, 09:28 PM
Mouse Mouse is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Alaska
Posts: 3 Mouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here's an attachment w/ sample data and some of the queries I tried for referance. Sorry, should have included it before.

What I'm trying to get out is:

Comp Name Date Stat
1 Dave 1/2/2004 Unsat
22 Dave 1/2/2004 Unsat
333 Joe 1/2/2004 Sat
Attached Files
File Type: zip dbase.zip (29.1 KB, 163 views)

Reply With Quote
  #3  
Old January 22nd, 2004, 10:03 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Here is what I have done

I have created two queries

FindRecentLogForComp - which find that most recent log date for that computer

MostRecentStatus - which uses FindRecentLogForComp to link back to the orginal data to get me all the info of the most recent log.

S-

Reply With Quote
  #4  
Old January 22nd, 2004, 10:54 AM
Mouse Mouse is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Alaska
Posts: 3 Mouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Nice! I hadn't even thought of multiple joins. I'll try this on the live data and let you know if it worked. Thank you very much!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Excluding records based on date


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 5 hosted by Hostway