# ASP/MSAccess Query: Where I am Wrong?

**URL:** https://forum.kirupa.com/t/asp-msaccess-query-where-i-am-wrong/216894
**Category:** programming
**Created:** [February 21, 2007, 12:45pm UTC](https://forum.kirupa.com/t/asp-msaccess-query-where-i-am-wrong/216894 "2007-02-21T12:45:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![webmulgor](https://avatars.discourse-cdn.com/v4/letter/w/ed8c4c/32.png) [@webmulgor](https://forum.kirupa.com/u/webmulgor)
#### Post date: [February 21, 2007, 12:45pm UTC](https://forum.kirupa.com/t/asp-msaccess-query-where-i-am-wrong/216894/1 "2007-02-21T12:45:17Z")

</div>

:h:

strSQL = “SELECT matri.\* FROM matri WHERE matri.d\_dob between # '”& dobto &"’ # and #’" & dobfrom &"’#;"

**dobto** and **dobfrom** is storing two different dates.  
**d\_dob** is Date Field

**Error i get is…**  
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)  
[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query expression ‘matri.d\_dob between # ‘2/23/1973’ # and #‘2/23/1982’#’.
