从日期到日期报告 [英] From date to date report
问题描述
大家好,我想知道如何过滤报告以制作日期和日期文本框,一旦我点击获取报告,显示我之前选择它们的那两个日期之间的所有数据...可以任何人请帮助我,。谢谢
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
推荐答案
您需要将两个日期传递给您的报告并在您的select sql语句中使用它们。
样本:
You need to pass two dates to your report and use them in your select sql statement.
Sample:
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
根据您使用的报告类型/控件,尝试找出如何将Date参数传递给您的报表以及如何在SQL语句中使用它或使用您正在使用的报表控件详细信息更新问题。
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.
sqlcommand cmd=new sqlcommand("select * from tbl_name where date between between '" + txtfromdate.ToShortDateString() + "' and '" + txttodate.ToShortDateString() + "'",con)
txtfromdate.ToShortDateString()& txttodate.ToShortDateString()= textbox ID的值;
date =列名;
con = Sqlconnection;
记住总是你必须得到日期的值(即)文化信息不是字符串
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
这篇关于从日期到日期报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!