James Murrell
asked on
each month
bit brain dead today, i have this code, how can i make it automatically do previous month at the mo i have to enter manually....
select count(*) as times,member_id,licensed,used
from user_count
where used > licensed+1 and dt_stamp between '2007-02-01' and '2007-02-28'
group by member_id,licensed,used
order by member_id, used
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
from user_count
where used > licensed+1 and dt_stamp between dateadd(m, -1, getdate()) and gettdate()
group by member_id,licensed,used
order by member_id, used