Hi All in my table i have date column using that i have to retrieve the data. ALTER procedure [dbo].[S2Commerce_GetSalesReport] @Filter nvarchar(50), @fromdate datetime, @todate datetime exec S2Commerce_GetSalesReport Filter,'10/30/2009','10/31/2009' when i exec this i not getting data i have data in my table for the date 10/31/2009. exec S2Commerce_GetSalesReport ProductName,'10/31/2009','11/1/2009' when i exec this i am getting data tell me what is the problem i comparing this using (orderDate<=@fromdate and orderDate>=@ToDate) also if i pass same date for fromdate and todate i am not getting data.Like this exec S2Commerce_GetSalesReport Filter,'10/31/2009','10/31/2009' give me the solution it's urgent
Thanks
|
| Author: Anuraj 02 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
Try using Between operator instead of lessthan or equal to and greater than or equal to
like
DATE BETWEEN DATE1 AND DATE2
Thanks Anuraj THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS. BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT. dotnetthoghts
|
| Author: Naresh 02 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
Hi Anuraj With Between i am not getting fromdate and todate data
|
| Author: Satish Kumar J 02 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
only compare the dates without time, may time comaparsion is causing the problem, check cast convert methods for converting date.
HTH
Regards, Satish My Blog
|
| Author: Manick 02 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
Check the passing parameter date format with database date format. It may cause the problem for date mismatch..
Regards, Manick
|