How can I convert a date format to it's numerical equivalent inside of a query? For instance, 1/1/2014 to be 41640.
Thanks
How can I convert a date format to it's numerical equivalent inside of a query? For instance, 1/1/2014 to be 41640.
Thanks
Assuming that your Date field is stored as Date and not Text, one way is to use one of the numeric conversion functions, like CDbl:
CDbl([DateField])
Be aware, all the number conversion functions will error on Null and alpha/empty string. So if there is possibility field is Null, need to handle.
CDbl(Nz([DateField]))
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.