General discussion

Locked

Access Date Var Type Mismatch -SQL Stat.

By yatst ·
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 & "#)" _

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access Date Var Type Mismatch -SQL Stat.

by jillbean In reply to Access Date Var Type Mism ...

WHERE (((labor.DATE)>= #" & cstr(RptBegDt) & "#)
etc.

Collapse -

Access Date Var Type Mismatch -SQL Stat.

by yatst In reply to Access Date Var Type Mism ...

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.

Collapse -

Access Date Var Type Mismatch -SQL Stat.

by jillbean In reply to Access Date Var Type Mism ...

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!

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums