I have several tables in an SQL 2005 database. Each table has 2 fields maintdate and Isdeleted.
The maintdate field says when the row was updated.
The IsDeleted field says if the record is logically deleted (to be physically deleted at a later date)
For each table I want a count of the number of rows where the maintdate is in the last week and Isdeleted = N. The outupt would look something like this.
Table Name, Maintdate Today, MaintDate Yesterday,....,MaintDate 7 days ago.