access里6位数的数字型字段转化为日期型用什么函数

2024-11-28 02:47:28
推荐回答(2个)
回答1:

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 日期比较

回答2:

data()