+ Reply to Thread
Results 1 to 3 of 3

Query language problem

  1. #1
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Query language problem

    I think I have been looking at this too long.

    I have to run a query on a database and I believe I have a syntax error somewhere in the query. I have been staring at it too long to try to figure it out.

    Please Login or Register  to view this content.
    It pulls the fields above, sums the total of the Expenditures_YTD column for each item, and returns result. Or, at least, it is supposed to.

    The VB code is fine, it works on other queries without the SUM part just fine, but in this one I have something wrong in the syntax.

    Any help would be appreciated.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Query language problem

    Just a rough shot, I assume the HAVING segment is working fine.

    Did you miss a comma? Or is "M.CF M.Sum(EXPENDITURES_YTD)" a single column?
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    04-10-2014
    Location
    Tallahassee, FL
    MS-Off Ver
    Excel 2010
    Posts
    98

    Re: Query language problem

    The comma was part of it, but not the added text under Group. That was not it.

    Ok, originally I thought the problem was the double quotes vs. single quotes, but thankfully the SQL query corrects that.

    Now I managed to comment out the offending parts to find exactly where the problem is and I get the following:
    Please Login or Register  to view this content.
    I need all those fields in the SELECT section, but even adding ONE of them causes an error. I can do without the extra HAVING field.

    For the record, this code works here when put into the query, but I need to be able to modify the year each time so I can't leave the 13M in there. It also pulls the data in the wrong order (correct order is above).
    Please Login or Register  to view this content.
    Last edited by Phixer; 05-02-2014 at 10:41 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Language problem
    By magnum206 in forum Excel General
    Replies: 5
    Last Post: 06-04-2011, 08:11 AM
  2. Language problem
    By Molecheese in forum Excel General
    Replies: 1
    Last Post: 05-11-2009, 04:08 PM
  3. language translation problem?
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2008, 02:50 PM
  4. Change query dialog-box language?
    By Alexander [email protected] in forum Excel General
    Replies: 2
    Last Post: 01-11-2006, 01:40 PM
  5. Problem with Language
    By Robert57 in forum Excel General
    Replies: 10
    Last Post: 12-23-2005, 06:25 AM

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