couple things - for BETWEEN you should start with the earlier date first.and getdate() will be NOW down to the millisecond so you just need to decide what you want if posting_date is exactly 60 days ago. If posting_date is at say 11:03 AM then you'll get different answers when you run the report at 10:30 AM then you would at 11:30 AM. So you probably want 60 days ago at 00:00:00.000 to tonight at 11:59:59.999 right? So this would cover the full 60 day range regardless of time of day:where posting_date >= dateadd(day, datediff(day, 0, getdate()-60),0) --60 days ago at 00:00:00.000and posting_date < dateadd(day, datediff(day, 0, getdate()+1),0) --tomorrow morning at 00:00:00.000
Be One with the OptimizerTG