在Access SQL查询中比较日期 [英] Comparing date in Access SQL query

查看:364
本文介绍了在Access SQL查询中比较日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Access sql查询时遇到问题。新的这个bieng一个菜鸟,很难弄清楚语法。下面是我的查询。

I'm having trouble with Access sql query. Im new to this so bieng a rookie its difficult to figure out the syntax. below is my query.

SELECT *
FROM BookingMaster where JourneyDate = #01/08/2012#;

是各自的表格数据:

BookingID   BookingDate JourneyDate CustomerName    TelephoneNo Address
5             01-08-2012       01-08-2012        roshan    78889      hjgj  

上述列出的查询会返回0个结果,即使数据存在01/08/2012旅行日期。

the above query listed returns 0 results even though data exist for 01/08/2012 journey date.

请帮助我。

推荐答案

除非你在美国的地区工作,最好使用年,月,日日期格式:

Unless you are working in a US locale, it is best to use a year, month, day format for dates:

SELECT *
FROM BookingMaster where JourneyDate = #2012/08/01#;

这篇关于在Access SQL查询中比较日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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