Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - In access, what function is used to convert a 6-digit field into a date field?
In access, what function is used to convert a 6-digit field into a date field?
SELECT *,CDate(Left(CStr(numtime),4)amp; -' & amp; Right(CStr(numtime), 2)) as numtime2, DateDiff('d', [dtime], [numtime2]) as diffnum.

From table1where datediff ('d', [dtime], cdate (left (CSTR (digital time), 4)&; -' & amp; Right(CStr(numtime),2)))& gt; =0 The key is to convert the number into a qualified date string such as "2002-07", then convert the string into a date type, and then compare it with other date type fields cdate (left (CSTR (num time), 4)&; -' & amp; Right(CStr(numtime), 2)) This is a DateDiff date comparison for conversion.