在两个日期之间搜索 [英] Search between two date

查看:100
本文介绍了在两个日期之间搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如何通过表格中的掩码从表中两个单元格的两个日期之间搜索?

请帮助我提供示例代码.

解决方案

如果只想显示两个日期之间的数据,请在数据源上运行SQL查询,该查询指定日期范围和要检查的列.如果这不是您的意思,请尝试使您的问题更清楚.我们可以为您清理拼写,这不是问题.但是,您需要弄清您想知道的内容,尝试过的内容等.


您需要使用 WHERE EndDate< ; @EndDate AND St​​artDate> @StartDate 在您的查询中,其中@EndDate和@StartDate是像这样创建的参数 cmdSelect.Parameters.AddWithValue("@ EndDate",dteEnd)


好的
我在程序中的该表中有该表的两个字段date(start_date,end,date)
对于Serch Betwin两个日期,我在表单上使用了遮罩,但不幸的是
没有回答可能是语法上的问题
****************************************************** ****
将dim sql转换为string = nothing
sql =从表中的位置选择*"& amp; mask.text& amp; "betwin开始日期和结束日期"


Hi
How do I search between two dates from two cells in a table by a mask in form?

Please help me with sample code.

解决方案

If you want to show data only between two dates, run a SQL query on your data source that specifies the date range and the column to check against. If that''s not what you mean, try to make your question clearer. We can clean up your spelling for you, that''s not a problem. But, you need to make clear what it is you want to know, what you''ve tried, etc.


You need to use WHERE EndDate < @EndDate AND StartDate > @StartDate in your query where @EndDate and @StartDate are parameters created tlike this cmdSelect.Parameters.AddWithValue("@EndDate",dteEnd)


hi
ok
i have table in my program in that table two field of date(start_date,end,date)
for serch betwin two date i use from mask on the form but unfortunately
dont answered may be prblem in syntax
******************************************************
dim sql as string=nothing
sql = "select * from table where" &amp;mask.text &amp; "betwin start_date and end_date"


这篇关于在两个日期之间搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆