Ok!! Here's the Problem. I am working on a perf stats report. FileType is First 9 chars of the field FileName. I need to compare a similar filename from this month to last month or before ordered by file size.
Maybe this is a very simple query but currrently my mind refuses to work. Seeking F1.
It's probably going to be one of these ugly joins. I am assuming you want the TimeInSeconds, and Size fields for comparisons? I had to do something similar for doing DB size trend analyses. My solution was to put a runnumber on the table, in order to guarantee that I was able to compare certain points to each other. This works great, if you have absolute control over the process, which you might not have. How about
from perf b join perf a on convert(varchar(10), a.StartDate) = convert(varchar(10), dateadd (dd, -30, b.StartDate))
where a.transID = something
That should get you the day of TransID, and 30 days before that, and 30 days before that, and.... Let me know if it does not work out.