两个日期之间来自数据库的检索数据 [英] retreive data from the database in between two dates
本文介绍了两个日期之间来自数据库的检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何通过在html页面(前端)中提供日期输入来在两个日期之间检索数据库中的数据。请帮我解决此问题。谢谢U
解决方案
您使用的是哪个数据库,您可以使用javascript获取如下记录:
您可以使用名为ACCESSdb的javascript库,可在此处找到:< a href =http://www.accessdb.org/> ACCESSdb [^]
功能SelectRecords (startdate,enddate){
var adoConn = new ActiveXObject( ADODB.Connection);
var adoCmd = new ActiveXObject( ADODB.Command);
adoConn.Open( Provider = Microsoft.Jet.OLEDB.4.0; Data Source = '\\dbName.mdb'跨度>);
adoCmd.ActiveConnection = adoConn;
adoCmd.CommandText( 选择*来自tblName其中startdate和enddate之间的日期);
adoCmd.Execute();
adoConn.Close();
}
参考:这里
how can i retreive data from the database in between two dates by giving Date inputs in an html page(front-end).Help me regarding this..Thank U
解决方案
Which database are you using you can use javascript to get the records like below:
You can use javascript library called ACCESSdb which can be found here:ACCESSdb[^]
function SelectRecords(startdate, enddate) { var adoConn = new ActiveXObject("ADODB.Connection"); var adoCmd = new ActiveXObject("ADODB.Command"); adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\\dbName.mdb'"); adoCmd.ActiveConnection = adoConn; adoCmd.CommandText("Select * From tblName Where Date between startdate and enddate"); adoCmd.Execute(); adoConn.Close(); }
Ref:Here
这篇关于两个日期之间来自数据库的检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文