#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Australia
    Posts
    39
    Rep Power
    13

    Computed field SQL Query in Access 2000


    I am trying to run a SQL query in Access 2000

    From the a table called Item, I want to display the following fields

    • Item Id
    • Description
    • Cost
    • Selling Price


    I only want to display those items where the difference between the cost of the item and the selling price is less than $2.00

    I use this first line to determine the difference between cost and selling price no problems
    Code:
    SELECT [Item Id], [Description], [Selling Price] - [Cost] AS [Difference]
    I use this line to define which table the data comes from
    Code:
    FROM [Item]
    How do I then define to only display those items where the difference is less than $2.00??
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    Australia
    Posts
    39
    Rep Power
    13
    Doh!!

    I figured it out, I was approaching it all wrong and in the end it was very simple

    Code:
    SELECT [Item Id], [Description], [Selling Price], [Cost]  
    FROM [Item]
    WHERE  [Selling Price] - [Cost] <2;

IMN logo majestic logo threadwatch logo seochat tools logo