陶 陶庆 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-03 #1 在sql中,查询一段日期,怎么查。 2000-01-01到2000-03-30,我只想查询2000年所有2月份的记录。
Z Zythum Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-03 #2 Where Extract(Year From 日期字段) = 2000 and Extract(Month From 日期字段) = 2
L liuchuanbo Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-03 #3 sql.add('and d2.busedate>=:time1 and d2.busedate>=:time2 '); if edit3.text<>'' then parambyname('time1').asdate:=strtodate(edit3.text); if edit4.text<> '' then parambyname('time2').asdate:=strtodate(edit4.text); 供参考 可设(edit3.text- edit4.text 为2000-01-01到2000-03-30)
sql.add('and d2.busedate>=:time1 and d2.busedate>=:time2 '); if edit3.text<>'' then parambyname('time1').asdate:=strtodate(edit3.text); if edit4.text<> '' then parambyname('time2').asdate:=strtodate(edit4.text); 供参考 可设(edit3.text- edit4.text 为2000-01-01到2000-03-30)
M mech Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-03 #4 select * from xxx where year(mydate)=2000 and month(mydate)=2
P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-03 #5 什么意思嘛, where xxx>="2/1/2000" and xxx<"3/1/2000") 不行啊 (上面格式是interbase的,其他数据库各有规定,大同小异)
C chariot Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-15 #6 ORACLE: where to_char(xxx,'yyyymm') = '200002'
张 张剑波 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-15 #7 用decodedate函数 例: var year,month,day:word; begin decodedate(now,year,month,day); ...... where year=2000 and month=2
用decodedate函数 例: var year,month,day:word; begin decodedate(now,year,month,day); ...... where year=2000 and month=2