A
Adam
Hi All,
I have the below module, which converts a database field from an
integer into a date format (UK Date .i.e dd/mm/yyyy).
Please see below:
Function ConvertDate(InputValue As Variant) As Variant
Dim lngDay As Long
Dim lngMonth As Long
Dim lngYear As Long
If IsNull(InputValue) = False Then
lngYear = InputValue \ 65536
lngMonth = (InputValue Mod 65536) \ 256
lngDay = InputValue - (lngYear * 65536) - (lngMonth * 256)
ConvertDate = DateSerial(lngYear, lngMonth, lngDay)
Else
ConvertDate = Null
End If
End Function
This ran quite quickly in Access 97 however now that I've exported it
into my Access XP database it is running a lot slower!!!
Can anyone see why it would be so slow now? Is there any improvements
that could be made to the module code??
Many Thanks for your help
Adam
I have the below module, which converts a database field from an
integer into a date format (UK Date .i.e dd/mm/yyyy).
Please see below:
Function ConvertDate(InputValue As Variant) As Variant
Dim lngDay As Long
Dim lngMonth As Long
Dim lngYear As Long
If IsNull(InputValue) = False Then
lngYear = InputValue \ 65536
lngMonth = (InputValue Mod 65536) \ 256
lngDay = InputValue - (lngYear * 65536) - (lngMonth * 256)
ConvertDate = DateSerial(lngYear, lngMonth, lngDay)
Else
ConvertDate = Null
End If
End Function
This ran quite quickly in Access 97 however now that I've exported it
into my Access XP database it is running a lot slower!!!
Can anyone see why it would be so slow now? Is there any improvements
that could be made to the module code??
Many Thanks for your help
Adam