|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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- |
|
#4
|
|||
|
|||
|
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!
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Excluding records based on date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|