Discussion Locked

Access Date Var Type Mismatch -SQL Stat.

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am receiving a type mismatch error in SQL statement used for my recordsource. All fields are dates and the public variable is "as date". Could you check my syntax and see if there is an error there or . . . . ?

& "WHERE (((labor.DATE)>= #" & RptBegDt & "#) AND((labor.DATE)<= #" & RptEndDt & "#)" _

3 replies

by yatst

I don't think this will work. The field I am querying is a date field. If i convert the date to a string it won't retrieve the data.

by jillbean

You are building a query string in code. It is a string. & is the concatenation of two strings. Therefore you need to turn the date into a string. You end up with:

where labor.date = #01/01/2001#

when the concatenation is done. You aren't permitted to concatenate a string and a double. You didn't even try my solution!

This discussion is closed to new replies.