按指定日期查詢(xún)數(shù)據(jù)庫(kù)的實(shí)例代碼分享
作者: 來(lái)源: 發(fā)布時(shí)間:2011-6-20 11:40:05 點(diǎn)擊:
本文提供給大家分享的是關(guān)于一個(gè)按指定日期查詢(xún)數(shù)據(jù)庫(kù)的實(shí)例代碼,希望能夠給大家?guī)?lái)幫助或啟發(fā)。
sql="select * from biao where DateDiff('d',date,#2006-2-15#)=0"
sql="select * from biao where DateDiff('m',date,#2006-2-15#)=0"
sql="select * from biao where DateDiff('y',date,#2006-2-15#)=0"
sql="select * from biao where DateDiff('m',date,date())=0"
sql="select * from biao where DateDiff('m',date,now())=0"
以上測(cè)試成功!
表名 biao
字段 date (時(shí)間類(lèi)型)
sql="select * from biao where DateDiff('m',date,#2006-2-15#)=0"
sql="select * from biao where DateDiff('y',date,#2006-2-15#)=0"
sql="select * from biao where DateDiff('m',date,date())=0"
sql="select * from biao where DateDiff('m',date,now())=0"
以上測(cè)試成功!
表名 biao
字段 date (時(shí)間類(lèi)型)
[收藏此文章]