如何使用MySQL查询实时搜索 [英] How to search from date to date using MySQL query

查看:98
本文介绍了如何使用MySQL查询实时搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,在按日期范围搜索时遇到问题,我给2个文本框"StartDate"和"EndDate"都分配了jquery datepicker,以便从MySQL数据库中检索信息,但是现在我想从"StartDate"中检索信息"仅添加到"EndDate",想使用按钮控件显示日期范围信息",此刻我的MySQL查询是

hi all, having a problem searching by date ranges I got 2 textboxes "StartDate" and "EndDate" both have the jquery datepicker assigned to them im retrieving information from a MySQL database but now i want to retrieve information from the "StartDate" to the "EndDate" only, would like to use a button control "Show date range info", my MySQL query at the moment is

SELECT transactions.transaction_id, transactions.date_time, transaction_type.transaction_type_description, transactions.amount FROM `transactions`" +
"INNER JOIN transaction_type ON transaction_type.transaction_type_id = transactions.transaction_type_id " +
"WHERE account_or_member_id = '53' and is_member = '1' " +
"Order by transactions.date_time ASC",con2



任何帮助请
Wes



any help please
Wes

推荐答案

尝试:
SELECT * FROM myTable WHERE myDateColumn BETWEEN '2011-01-01' AND '2012-06-31'


这篇关于如何使用MySQL查询实时搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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