当我在Msaccess数据库中使用sql查询检查specfic日期时无法正常工作 [英] when i check specfic date using sql query in Msaccess database not working

查看:88
本文介绍了当我在Msaccess数据库中使用sql查询检查specfic日期时无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MS Access数据库;



当我运行以下查询时;



select * from Tb_SCh_TIme_Table



MS Access Data Base;

when i run the below query;

select * from Tb_SCh_TIme_Table

 Sch_Date	Session	Course	Faculty_Code
2/11/2013	1	ARPA	BAB
2/12/2013	1	CHEMCO	BSR
2/13/2013	3	CL2	CJJ 




当我运行以下查询时




when i run the Below query

select * from Tb_SCh_TIme_Table where Sch_Date = 2/11/2013





输出不是为什么?



我上面的查询有什么问题?



请帮帮我。



问候,

Narasiman P.



The output is not coming why?

what is the problem in my above query?

Please help me.

Regards,
Narasiman P.

推荐答案

使用此查询

use this query
"select * from Tb_SCh_TIme_Table where Sch_Date = #2/11/2013#"



也会通过以下链接。

http://office.microsoft.com/en-in/access-help/where-clause-HP001032287.aspx [ ^ ]


请试试这个:



please try this:

select * from Tb_SCh_TIme_Table where Sch_Date like '2/11/2013'






or

select * from Tb_SCh_TIme_Table where Sch_Date = '2/11/2013'


试试这个



try this

Datetime date = DateTime.Parse("2/11/2011");
// initialize the vaialbe





现在写下查询。





now write the query.

select * from Tb_SCh_TIme_Table where Sch_Date = '"+ date +"' ;


这篇关于当我在Msaccess数据库中使用sql查询检查specfic日期时无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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