SELECT *,CDate(Left(CStr(numtime),4)&'-'&Right(CStr(numtime),2)) as numtime2 ,DateDiff('d', [dtime], [numtime2] ) as diffnum
FROM 表1 where DateDiff('d', [dtime], CDate(Left(CStr(numtime),4)&'-'&Right(CStr(numtime),2)) )>=0关键是要把数字的转换成合格的日期字符串如“2002-07”,再把该字符串转成日期型,再和其他日期型字段进行比较CDate(Left(CStr(numtime),4)&'-'&Right(CStr(numtime),2)) 这是进行转换DateDiff 日期比较
data()