convert long to 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
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top