如何从MS Access Table检索数据 [英] How do I retrieve data from MS Access Table

查看:63
本文介绍了如何从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


这篇关于如何从MS Access Table检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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