Results 1 to 7 of 7
  1. #1
    Join Date
    May 2005
    Posts
    15

    Unanswered: Problem in creating buckets in Access

    IN Access XP, I have a query to bucket the revenues of various line item transactions which is working perfectly fine.
    Code:
    SELECT Revenue.ACCOUNT_NO, Revenue.INVOICE_NO,
    Revenue.TOTAL_INVOICE_AMOUNT, bucket.[startvalue], 
    bucket.[endvalue] FROM Revenue INNER JOIN Bucket ON 
    Revenue.TOTAL_INVOICE_AMOUNT between 
    (bucket.[startvalue] and bucket.[endvalue]);
    But when I copy the same query in other blank window query and run the query I get an error
    'Missing ), ], or Item in query expression 'Revenue.TOTAL_INVOICE_AMOUNT between (bucket.[startvalue]'.

    What could be going wrong ?

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    It means that something is MISSING.
    Check if the copy is the same as a source is.

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try
    PHP Code:
    INNER JOIN Bucket ON 
       Revenue
    .TOTAL_INVOICE_AMOUNT >= bucket.[startvalue
       AND 
       
    Revenue.TOTAL_INVOICE_AMOUNT <=  bucket.[endvalue]; 

  4. #4
    Join Date
    May 2005
    Posts
    15
    Thanks Hambakka, your solution is better than my own query and moreover it worked.

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by neeraj_chow
    ... and moreover it worked.
    an admirable criterion

    yours would've worked too, had you removed those pesky parentheses

    FROM Revenue
    INNER JOIN Bucket
    ON Revenue.TOTAL_INVOICE_AMOUNT between bucket.[startvalue] and bucket.[endvalue]
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Nov 2006
    Posts
    9
    Quote Originally Posted by r937
    an admirable criterion

    yours would've worked too, had you removed those pesky parentheses

    FROM Revenue
    INNER JOIN Bucket
    ON Revenue.TOTAL_INVOICE_AMOUNT between bucket.[startvalue] and bucket.[endvalue]
    yes, it should work now!
    a week ago i'd faced a similar problem..and got ti resolved..

  7. #7
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    That is fine..

Posting Permissions

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