Syntax Error in Excel Query for DATE field

G

Guest

I have created an excel query using ODBC, and linking to a financial software
products tables.

I am attempting to enter in a criteria to reduce the number of records
returned.

I am trying to put in a criteria against a DATE field. However when in
enter in a date and run the query I get the following error "Syntax Error".

Can someone help??
 
G

Guest

hi.
post your code. I'm not sure i can help but unless i see the code, all i
know for sure is that you have a syntax problem.

Regards
FSt1
 
G

Guest

Dear FST1,

For some background - I am usingExcel 2000, SP-3A.

1) I am going into DATA/GET EXTERNAL DATA/NEW DATABASE QUERY.
2) Selecting my ODBC source and connecting to the source with no issues.
3) Selecting a SINGLE table from the ODBC soucred database and then VIEWING
THE DATA OR EDIT THE DATA IN MICROSOFT QUERY.
4) Selecting the fields that I want to show in my query results (dropping
and dragging)
5) Choosing VIEW/CRITERIA and then dropping the DATE field in the criteria
section and enter in a date of the 01/05/2005.
6) When I then go RECORDS/QUERY NOW I received an error "SYNTAX ERROR".

If I use criteria for other fields (not date fields) then it works ok and I
do not get any error messages.

So I am not using any code.

Thoughts??

James
 
G

Guest

hi,
yes you are running code. in microsoft query,click on the SQL icon or go...
View>SQL. that's the code your are running.
MSQ is a gui (graphic user interface). by pointing and clicking in the gui,
it records your actions and records the code that corresponds with your
actions.
remember that all computers do is run code. even pointing and clicking or
typing on the keyboard causes code to run. it's call event driven programming.
but back to your problem.
since your are having problems with just the date field, i suspect that you
may need to inclose the date in pound signs with an operator ie >#1/1/05#.
the pound signs tell MSQ that it is a date and not a series of numbers.
post back if that isn't it.
and post the code.

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top