I need to change the DATEADD portion of the following query so it looks at the first day of the current month forward, instead of simply the previous 30 days.
Example, using the query shown below, and today's date of April 17th, I need it to say DATEADD(d,-17,getdate())
How do I write a query that automatically calculates how many days back the first day of the current month is?
select distinct cpid
where eventdate > DATEADD(d,-30,getdate())