The example I have is = Second (#10:13:58 AM#) and the argument must be a valid time.
But what if the numbers are strings? How could it be formatted to avoid a Type Mismatch error?
The example I have is = Second (#10:13:58 AM#) and the argument must be a valid time.
But what if the numbers are strings? How could it be formatted to avoid a Type Mismatch error?
Possibly convert with CDate() function.
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.
I though of that too. Did it work for you ?
You did not try?
VBA immediate window:
?IsDate(CDate("10:13:58 AM"))
returns True
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.
Thanks June I have it now.
Be aware conversion functions error if input is Null. If that is possibility, can handle Null with Nz()
CDate(Nz(field,0))
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.