如何从MS Access Table检索数据
问题描述:
我正在使用VS2010和MSACCES 2007.
我有这样的查询:
I am using VS2010 and MSACCES 2007.
I have query like this:
select * from my_table where my_field between #11-10-2013 11:12:13 AM# and #15-12-2013 10:55:56 PM#
my_field
是日期/时间和一般格式,即 19-06-2007 5:34:23 PM (以ms访问)
它什么也没有返回。请帮助我。提前谢谢。
my_field
is of Date/Time and general format i.e. 19-06-2007 5:34:23 PM
(in ms access)
it's returning nothing. plz help me. thanks in advance.
答
查看您的查询:
Have a look at your query:
select * from my_table where date1 between #11-10-2013 11:12:13 AM# and #15-12-2013 10:55:56 PM#
此外 - 在你的问题中 - 你正在使用 my_field
。
我怀疑您需要更改查询,如下所示:
Further - in your question - you're using my_field
.
I suspect that you should need to change your query as is shown below:
select * from my_table where my_field between #11-10-2013 11:12:13 AM# and #15-12-2013 10:55:56 PM#
SELECT *
FROM my_table
WHERE my_field BETWEEN #mm/dd/yyy# and #mm/dd/yyy#
注意:替换 mm / dd / yyyy
带有实际日期并删除时间部分。
[/ EDIT]
Note: replace mm/dd/yyyy
with real dates and remove time parts.
[/EDIT]
Hai
u需要在select查询中转换日期然后只有你可以回复,或者在你的插入查询中你已经转换为dd / MM / yyyy,然后很容易回复表单访问
Hai
u need to convert date in select query then only u can retrive,or in ur insert query u have convert as dd/MM/yyyy,then easy to retrive form access