Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys, i'm wondering that how to filter the report to make from date and to date text boxes and once i click on get the report shows all the data between those two dates that i chosen them before... can any one help me please,.thanks
Posted
Comments
PIEBALDconsult 10-Aug-15 20:25pm    
BETWEEN?

You need to pass two dates to your report and use them in your select sql statement.
Sample:
SQL
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;

Depending on the report type/controls you are using, try to find how you can pass Date parameter to your report and how you can use it in the SQL statement Or update the question with report control details you are using.
 
Share this answer
 
C#
sqlcommand cmd=new sqlcommand("select * from tbl_name where date between between '" + txtfromdate.ToShortDateString() + "' and '" + txttodate.ToShortDateString() + "'",con)

txtfromdate.ToShortDateString()&txttodate.ToShortDateString()=textbox ID's Value;
date=column name;
con=Sqlconnection;
Remember Always u have to get the value in date (i.e) culture info not in string
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900