Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    1

    Criteria added to Query - Nothing showing

    I have a select query built that compares a volume from table 1 and a volume from table 2 and then subtracts one from the other to find the difference. I am trying to limit the difference to anything > 500 but when I add this criteria to the query it returns nothing. I know for a fact there are about 20 records that should appear in this criteria. The SQL code is listed below. Can someone help me with this? When I add the criteria >500 and run the query a parameter box for BookVol is popping up now. It does not do this without the criteria.



    Thanks,
    Erich


    SELECT Table1.PropCode, Table1.PropName, Table2.PropCode, Table2.PropName, Table1.ProdDate, Table1.Product, Table1.AccrualVol, Abs([BD46BQuantity]) AS BookVol, ([BookVol]-[AccrualVol]) AS VolDiff, Table1.AccrualVal, Abs([BD46BAmount]) AS BookVal, [BookVal]-[AccrualVal] AS ValDiff

    FROM Table2 INNER JOIN Table1 ON (Table2.PropCode = Table1.PropertyCode) AND (Table2.ProdCode = Table1.Product) AND (Table2.BD46BPeriod = Table1.ProdDate);

    WHERE (((([BookVol]-[AccrualVol]))>500));

  2. #2
    Join Date
    Mar 2009
    Posts
    3
    Try nesting the query.

    Something like this

    SELECT * FROM [SELECT Table1.PropCode, Table1.PropName, Table2.PropCode, Table2.PropName, Table1.ProdDate, Table1.Product, Table1.AccrualVol, Abs([BD46BQuantity]) AS BookVol, ([BookVol]-[AccrualVol]) AS VolDiff, Table1.AccrualVal, Abs([BD46BAmount]) AS BookVal, [BookVal]-[AccrualVal] AS ValDiff FROM Table2 INNER JOIN Table1 ON (Table2.PropCode = Table1.PropertyCode) AND (Table2.ProdCode = Table1.Product) AND (Table2.BD46BPeriod = Table1.ProdDate)] AS virtualTable1

    WHERE (BookVol-AccrualVol)>500;

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

Similar Threads

  1. Query Criteria
    By Texaine in forum Queries
    Replies: 1
    Last Post: 01-24-2018, 02:36 PM
  2. Replies: 4
    Last Post: 01-29-2009, 02:43 AM
  3. Query Criteria
    By jena in forum Queries
    Replies: 1
    Last Post: 04-29-2008, 11:00 AM
  4. Added items in a column.
    By Wrangler in forum Forms
    Replies: 3
    Last Post: 03-25-2006, 07:56 PM
  5. Null Values not showing up in a Query
    By Valli in forum Queries
    Replies: 0
    Last Post: 01-04-2006, 03:53 PM

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