ChrisM@Work (12/5/2012)
Can you post your original query, George? The last two weeks' version? Cheers.
My original query was:
SELECT PropertyInformation.BRTNumber, PropertyInformation.ClientsKey, PropertyInformation.ProductKey, PropertyInformation.DateFinished,
PropertyInformation.Finished, PropertyInformation.ReportType, PropertyInformation.Premises, PropertyInformation.OrderDate,
PropertyInformation.ClientKey, PropertyInformation.Invoiced, Fees.CaseNumberKey, Fees.Total, Fees.Summary, ClientTable.ClientKey AS Expr1
FROM PropertyInformation INNER JOIN
Fees ON PropertyInformation.CaseNumberKey = Fees.CaseNumberKey INNER JOIN
ClientTable ON PropertyInformation.ClientKey = ClientTable.ClientKey
WHERE (PropertyInformation.Finished = - 1) AND (PropertyInformation.ClientKey = 2) AND (PropertyInformation.DateFinished >= DATEADD(hour, - 336,
GETDATE())) AND (PropertyInformation.OrderDate > CONVERT(DATETIME, '2011-06-30 00:00:00', 102))
ORDER BY PropertyInformation.ClientsKey
Obviously this does not translate though as 1 month is not always a set amount of time.