SELECT Count(*)
FROM [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN GETDATE() AND DATEADD(day, 1, GETDATE()))
SELECT Count(*)
FROM [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN dateadd(day,-8,GETDATE()) AND GETDATE())
SELECT Count(*)
FROM [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn >DATEADD(day, 1, GETDATE()))
Vishal JoshiPosted Jun 6, 2023, 1:26 PM
Hello Sandeep,
You can write a single query and pass parameters to make it generic. please check the below code.
Thanks
Vishal Joshi
Mohamed Azarudeen ZPosted Jun 6, 2023, 9:51 AM
Query 1:
Query 2:
Query 3:
Make sure to replace "BV_OCMContext" and "TblBatch" with the appropriate names used in your application. Also, adjust the logic for getting the current date based on your system's timezone and requirements.