I try not to write expressions that don't explicitly change data from one
type to another and then back again. I also don't like to create complex
expressions/calculations that might be useful in several places in an
application. Consider using a small function like the following which you
can paste into a new module and save it as "basDateConversions". Then, in a
query, you can call it like:
TrueDate: ConvertYMD([YourYYYYMMDDFieldName])
Function ConvertYMD(varDate As Variant) As Date
Dim intYear As Integer
Dim intMth As Integer
Dim intDay As Integer
If IsNull(varDate) Then
ConvertYMD = 0
Else
intYear = varDate \ 10000
intMth = (varDate Mod 10000) \ 100
intDay = varDate Mod 100
ConvertYMD = DateSerial(intYear, intMth, intDay)
End If
End Function