select * from tabel1 where birthday = #2004-03-15#
select * from tabel where CAST(month(birthday) AS CHAR(2)) +CAST(day(birthday) AS CHAR(2)) =CAST(month(getdate()) AS CHAR(2)) +CAST(day(getdate()) AS CHAR(2))
select * from table1 where FormatDateTime(birthday,'yyyymmdd')=FormatDateTime(sysdate,'yyyymmdd') function FormatDateTime(const Format: string; DateTime: TDateTime): string;
试一试 select * from table1 where month(birthday)=month(getdate()) and day(birthday)=day(getdate())
where to_char(birthday,'yyyymmdd')=to_char(sysdate,'yyyymmdd')
select * from table1 where to_char(Birthday,'MM-DD')='03-15';
多谢一楼的兄台, 可是提示出错:“表达式中 to_char函数不存在!”顺便说一句, 我使用的是DAODataSet1访问Access数据库,
Birthday为"日期/时间"型。
where CAST(month(birthday) AS CHAR(2))
+CAST(day(birthday) AS CHAR(2))
=CAST(month(getdate()) AS CHAR(2))
+CAST(day(getdate()) AS CHAR(2))
where FormatDateTime(birthday,'yyyymmdd')=FormatDateTime(sysdate,'yyyymmdd')
function FormatDateTime(const Format: string; DateTime: TDateTime): string;
select * from table1 where month(birthday)=month(getdate()) and day(birthday)=day(getdate())