I have a Windows app, this query DB and put a data in Excel. I schedule to run on last day of month in Win Scheduler task... the 30th.
If it run on the 30th, will it query from the 1st to 30th.? Actually, I really want it to query from the 1st to the lastday of the month, but not sure how.
Select mycustomer, dateordered, etc...from table where month(ordersubmitted) = datepart(month, getdate()) and year(ordersubmitted) = datepart(year, getdate())