convert long to date?

  • Thread starter Thread starter Egg
  • Start date Start date
E

Egg

Dear All,

I try to use a function CVDate to convert a long number to date format. It
is very straight, if I use the following code at VB, it is return the value
that I wanted. But if I put the exact function on Access, it return "Type
Mismatch" Error. Anyone know why? Please advise how to make Access works on
the following function. Many thanks.

MsgBox cvDate(226998025) - VB returns "12/03/2007 15:00:25"

MsgBox cvDate(226998025) - Access returns "Type Mismatch"



Regards,


Daryl
 
On my system typing this expression in the Immediate Window
? CVDate(226998025)
generates the same error (Type Mismatch.)

The argument for CVDate() is supposed to be any expression that can be
interpreted as a date. Your long integer cannot be in understood as a valid
date.
 
Back
Top