Query question 
Author Message
 Query question

I did actually check the Access Help before I posted this time.  Here's the
problem:  I'm trying to pull fields out of an Access ODBC database based on
restriction of two dates.  Here's my syntax:

SELECT * FROM Services WHERE Customer=22 AND (SDate BETWEEN #2001-2-24# AND
#2001-3-31#) ORDER BY SDate ASC, ID ASC;

When I type this into Access as an SQL Query, it works perfectly.  When I
try to run my Java JDBC-ODBC program (the rest of it does work), I get an
error:

[Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query
expression on 'Customer=22 AND (SDate BETWEEN #2001-2-24# AND #2001-3-31#)'.

The actual Java isn't the problem.  The problem is with the SQL query as far
as I can tell.  I can do other queries, like SDate=#2001-2-24# and it works
fine.

<timid voice>help</timid voice>

-chris



Sat, 15 Nov 2003 11:56:13 GMT
 Query question

Quote:

> I did actually check the Access Help before I posted this time.  Here's the
> problem:  I'm trying to pull fields out of an Access ODBC database based on
> restriction of two dates.  Here's my syntax:

I don't want to be snotty, but you should direct your questions to a
newsgroup devoted to Access, because this group is about MS SQL Server
which certainly is not the same thing. I believe there is a
comp.databases.ms-access.

--



Sun, 16 Nov 2003 05:44:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Query Question - Length of query

2. PSQL Query, CONVERT, and length of Query questions....

3. SQL Query question and unload db question

4. Follow up question to previous thread on VFP 5.0a query questions

5. Follow up question to previous thread on VFP 5.0a query questions

6. Parameterized query question

7. Query Question

8. Query question

9. SQL Query Question...can I do this?

10. Another query question..

11. DELETE query question

12. Distributed Query Question


 
Powered by phpBB® Forum Software