Mismatch error. Expected Date, but got String

rs.Field("dteVerify").DateValue =  d.ShortDate

I’ve looked around and my ideas are empty.


PS. “Date” is a tricky term in the English language when looking for solutions since it also include romance… and having that said, “mismatch error” is not rare! :slight_smile:

dateValue is a date object

d.shortDate is a string

Technically you are writing some thing like:
dim d as date
d=“A”

rs.Field("dteVerify").Value =  d.ShortDate

Not so pretty, but it works.

Thank you for the reply!
Based on your answer, I guess “StringValue” will work as well?
Well… there is only one way to find out! :slight_smile:

I was looking for the wrong answer! It happens…!

If you expect in your dteVerify field a date maybe a rs.Field(“dteVerify”).dateValue = d is better, since d.shortDate is a local translation of the date.
Otherwise you can use rs.Field(“dteVerify”).stringValue = d.sqlDate that is still a string but in the YYYY-MM-DD format.

Thank you!
I shall try to remember!

I really don’t like alternatives. All I want is that it works and now I’m happy, it works! :slight_smile:

(I read and tried SQLDate, but I did wrong.)