DECLARE @Date DATE = GETDATE();
WHERE Trade_Date >= DATEADD(MONTH, DATEDIFF(MONTH, 0, @Date), 0)
AND Trade_Date < DATEADD(MONTH, DATEDIFF(MONTH, 0, @Date)+1, 0);
What that does is calculate the first day of the current month, and the first day of the next month. Then it makes sure the Trade_Date >= first day of current, and < first day of next month.
Does that do what you need?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon