本文介绍了搜索日期FromDate ToDate所需的Sql查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我的网页上有两个文本框和一个搜索按钮.

第一个文本框来自-TxtFromDate
第二个文本框为-TxtDateTo

搜索按钮-BtnSearch


当用户输入两个日期(例如30/08/2012和15/09/2012)并单击搜索"按钮时.这些FromDate DateTo记录必须显示在Gridview中.

请你告诉我怎么做.

请帮忙.

顺便说一下,我需要Sql Query来搜索两个日期
我想可能是这样的事情.

请帮忙.

谢谢朋友.

Dear Friends,

I have Two Text boxes and a Search button on my WebPage.

First Textbox is From - TxtFromDate
Second Textbox is To - TxtDateTo

Search Button - BtnSearch


When user Enters Two dates Such as 30/08/2012 and 15/09/2012 and clicks on Search button. These FromDate DateTo Records must be displayed in Gridview.

Please can u show me how to do this.

Please help help.

By the way I need Sql Query to search the two dates
I think it might be BETWEEN something like that.

Please help .

Thank you Friends.

推荐答案

SELECT
   EmpId, Employeename, JoinDate
FROM
   MyEmployeeTable
WHERE
   JoinDate BETWEEN @FromDate AND @ToDate


SELECT *
FROM @Orders
WHERE Orderdate BETWEEN @FromDate AND @ToDate


更多来自..
http://forums.asp.net/t/1434093.aspx/1 [ ^ ]
http://www.dotnetfunda. com/forums/thread1517-what-is-a-query-to-select-records-between-two-dates.aspx [ ^ ]


more from..
http://forums.asp.net/t/1434093.aspx/1[^]
http://www.dotnetfunda.com/forums/thread1517-what-is-a-query-to-select-records-between-two-dates.aspx[^]



这篇关于搜索日期FromDate ToDate所需的Sql查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 23:09
查看更多