how to get data in between two date
i get data from sql server in between two days using stored producer
but when i enter date is same then my data not come
problem is how to get data between two date and same date
my query is
select * from save_master where date between @fromdate AND @todate
now the date is 1/2/2009 and 3/2/2009
i got data
but the date is same data not come because user wants data only one date then we also get data
please help me in sql queary



Jignesh KumarPosted Apr 8, 2023, 2:51 PM
Hello,
You can use >= and <= which will return same day data, you are using between which will not consider fromdate and todate,
Anwarul HaquePosted Apr 8, 2023, 12:03 PM
Another way try
select * from save_master where date >= @fromdate AND date <= @todate
if not work this work 100%
select * from save_master where (CONVERT(DATE,date ) >= CONVERT(DATE, @StartDate) and CONVERT(DATE, date ) <= CONVERT(DATE, @EndDate))
nagaraju yenumulaPosted Mar 16, 2020, 7:32 AM
Jiyaul MustaphaPosted Jul 26, 2019, 8:00 AM