Hi
this is my code:

Dim e As Date, f As Date
e = CDate("1/1/2004 23:55:00.32")
f = CDate("1/1/2004 00:00:00")

the result is type mismatch..... can you help me???
carlo

Re: date prob by Dmitriy

Dmitriy
Thu Apr 29 09:06:22 CDT 2004

What is .32? Just remove it

Dmitriy.

"Carlo" <marcocci@ingv.it> wrote in message
news:%23P8GvGfLEHA.2456@TK2MSFTNGP12.phx.gbl...
> Hi
> this is my code:
>
> Dim e As Date, f As Date
> e = CDate("1/1/2004 23:55:00.32")
> f = CDate("1/1/2004 00:00:00")
>
> the result is type mismatch..... can you help me???
> carlo
>
>



Re: date prob by Rick

Rick
Thu Apr 29 09:07:29 CDT 2004

> this is my code:
>
> Dim e As Date, f As Date
> e = CDate("1/1/2004 23:55:00.32")
> f = CDate("1/1/2004 00:00:00")
>
> the result is type mismatch..... can you help me???

VB's Date variable does not track fractions of a second... remove the
'.32' and all will be well.

Rick - MVP


Re: date prob by Mike

Mike
Thu Apr 29 09:14:21 CDT 2004

> this is my code:
<code snipped>
> the result is type mismatch..... can you help me???

Try using DateSerial() and TimeSerial() instead, I'm not sure how the system locale is taken into account with date literals but if
it was a problem then using the functions instead would circumvent that as they have named parameters.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: Http://www.mvps.org/EDais/