Results 1 to 7 of 7
  1. #1
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49

    Question Overflow error - change field type in query?

    Hi everyone,


    The query that is causing me trouble (posted below) is based on several other queries.

    Code:
    SELECT Region,  MIN(RoadLengthPerM2) as BestRL, MAX(RoadLengthPerM2) as worstRL, MIN(pctAG) as BestPctAG, MAX(pctAG) as WorstPctAG, MIN(pctDEV) as BestPctDEV, MAX(PctDEV) as WorstPctDEV, MIN(PctStreamsAltered) as BestASL, MAX(PctStreamsAltered) as WorstPctASL
    FROM qry_RatioAttributes
    GROUP BY Region
    Running this query gives me an "overflow" error. Apparently this is because I am trying to fit a value into an incorrect field type, but I have no idea what the field type resulting from a query is.

    qry_RatioAttributes gets all of the values used in the above query from double fields calculated as percentages of one another, and rounded to 3 decimal places.

    Any insight will be appreciated, could it be this rounding of numbers that is causing trouble?

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I do not see a problem with the query you posted, but out of curiosity, how did you round the values in qry_RatioAttributes?

  3. #3
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49
    Here is an excerpt of qry_RatioAttributes:

    Code:
    ...Round((Sum(tbl_Roads.RoadLength)/tbl_CatchmentsCSL.CatchmentArea),8) AS RoadLengthPerM2, Round((qry_LandCoverRaw.AG/tbl_CatchmentsCSL.CatchmentArea),5)*100 AS PctAG...
    I'm working on re-creating that query using more sub-queries... we'll see if that helps.

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I don't see an issue, so I cannot offer any suggestions. Hopefully you will find a solution.

  5. #5
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49

    Lightbulb

    It turns out that one of my columns from qry_RatioAttributes was returning an #Error. If I tried to sort by that column it would return an overflow error, so naturally it could not find it's min or max values either.

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Now that you found the issue were you able to solve it? I am thinking that you may need to use the NZ() function or an IIF() function to force a numeric result

  7. #7
    Lady_Jane is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    49
    I'm just using a "WHERE field <> "value"" in the original query to remove those records. I think in the long-term I'm gonna have to re-organize the original tables to get rid of this error.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 03-04-2011, 12:46 PM
  2. change data type in make table query
    By jgelpi16 in forum Queries
    Replies: 2
    Last Post: 01-26-2011, 09:37 AM
  3. change field to "password" type
    By ducecoop in forum Access
    Replies: 3
    Last Post: 11-11-2010, 12:02 PM
  4. Replies: 2
    Last Post: 12-03-2009, 05:06 PM
  5. Run time error '6': Overflow
    By wasim_sono in forum Access
    Replies: 0
    Last Post: 06-22-2007, 06:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums