Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002

    Unanswered: Query Question: using Expressions

    Hi all,

    I'm having trouble creating (what seems should be) a simple multi-table query. Basically, I have two fields on which I am doing a Count (e.g. No_Installed, and No_Removed); I have a third field which is an Expression (e.g. No_Delta) that is [No_Installed]-[No_Removed].

    What I want to do is to limit the query to only show data where No_Delta < 0, but when I try to do that no rows appear at all.


    No_Installed No_Removed No_Delta
    8 7 1
    14 21 -7
    10 12 -2

    i.e., I want only the last two rows where No_Delta<0. I'm thinking there's a problem because of being multi-table or Group By but I'm not sure...

    Thanks for any help!

  2. #2
    Join Date
    Nov 2001
    Select No_Installed, No_Removed, No_Installed - No_Removed as No_Delta From tblMyTable Where No_Installed < No_Removed;

  3. #3
    Join Date
    Apr 2002

    Cool Solution...

    Thanks for the input, I appreciate the help.

    In the meantime, I found a solution which seems to work quite satisfactorily: instead of trying to restrict the data based upon Delta<0 within the query, I added the following filter (outside the query):

    Last edited by lexloma; 05-16-02 at 10:45.

Posting Permissions

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