I have to display report each month in mssql,
select * from purchase Invoice where convert(Date,p.p_Date) between '2023-01-01' and '2023-01-31'
this works fine.
Now my requirement is to display a general sql statement where i can display report from mssql without changing date each month.
I mean if it system date is February it should
where convert(Date,p.p_Date) between '2023-02-01' and '2023-02-28' and june
where convert(Date,p.p_Date) between '2023-02-01' and '2023-02-28' and june