
September 7th, 2012, 09:01 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 1
Time spent in forums: 28 m 22 sec
Reputation Power: 0
|
|
|
Query: 1 table 2 different dates
Hi Everyone,
Im trying to get a select query for a daily backup report. In this case a report for date=03.09.2012
https://dl.dropbox.com/u/93299729/sql.png
On the left side is my table with the tasks name, date of backup type of backup and the state which says if the backup did run successfully.
These tasks are running everyday as incremental backup, and in between (mostly full once a week) there is a Full Backup.
On the right side is the result that i'm trying to get with a query. I want a daily report list for the backups.
The Last Full Backup column is easy:
Code:
select task, max(date) from table where type="Full" and state="OK" group by task
This query will give me the last date of a succesfully executed Full Backup. But how can i add this column to the rest of the query?
ty
|