如何根据日期从sql表中检索数据? [英] how to retrieve data from sql table according to date?
本文介绍了如何根据日期从sql表中检索数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好我想知道如何根据日期从sql表中检索数据..
为例。如果我想从日期a中检索表格中的特定或一行数据。
hello i am wondering how ti retrieve data from sql table arcording to the date..
as an example. if i would like to retrieve a specific or a row of data from a table from date a.
select * from table where table.date = a;
但我想发一个命令来检索数据,以便在等于日期a或日期之前检索数据。
but i would like to make a command to retrieve a data to retrieve data when it was equal to date a or before the date a..
select * from table where table.date = a or ......;
有谁可以帮我继续这个?或者我可能在格式上有一些错误..
can anyone help me to continue this?? or may be i got some error on the format ..
推荐答案
之前的日期相当于日期小于或等于所以:
"Date before" is equivalent to "date less than or equal" so :
select * from [table] where [table].[date] <= a
这篇关于如何根据日期从sql表中检索数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文