+ Reply to Thread
Results 1 to 4 of 4

Syntax Error in Excel Query for DATE field

  1. #1
    James T
    Guest

    Syntax Error in Excel Query for DATE field

    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??



  2. #2
    FSt1
    Guest

    RE: Syntax Error in Excel Query for DATE field

    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

    "James T" wrote:

    > 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??
    >
    >


  3. #3
    James T
    Guest

    RE: Syntax Error in Excel Query for DATE field

    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

    "FSt1" wrote:

    > 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
    >
    > "James T" wrote:
    >
    > > 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??
    > >
    > >


  4. #4
    FSt1
    Guest

    RE: Syntax Error in Excel Query for DATE field

    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

    "James T" wrote:

    > 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
    >
    > "FSt1" wrote:
    >
    > > 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
    > >
    > > "James T" wrote:
    > >
    > > > 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??
    > > >
    > > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1