select Count(*)
from [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN DATEADD(day, 1, GETDATE()) AND DATEADD(day, 2, GETDATE()))
Loading
select Count(*)
from [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN DATEADD(day, 1, GETDATE()) AND DATEADD(day, 2, GETDATE()))
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal JoshiPosted Jun 7, 2023, 1:08 PM
Vishal JoshiPosted Jun 8, 2023, 7:29 AM
Yes if you are expecting data for the same day then need it requires >= and for toDate it requires <=
Sandeep KumarPosted Jun 7, 2023, 1:25 PM
Here >= or only >
&& a.ScheduleDisposalOn > DateTime.Now.AddDays(-8)
Sandeep KumarPosted Jun 7, 2023, 12:55 PM
select Count(*)
from [BV_OCM].[dbo].[TblBatch] WHERE (DisposalStatus = 17) AND (ScheduleDisposalOn BETWEEN dateadd(day,-8,GETDATE()) AND GETDATE())
Vishal JoshiPosted Jun 7, 2023, 12:49 PM
Hello
Please try the below.
Thanks