Creating An If Statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pv003220
    New Member
    • Jun 2010
    • 5

    Creating An If Statement

    Hi guys I wonder if you could help me. I am trying to make an IF statement for the following fields:

    Quantity In Stock Quantity Re-Order Quantity Ordered


    The aim is so that if the quantity in stock level goes below the quantity re-order level, the product is fed into a report with the quantity ordered value wrote next to it. Does any of you have any idea on how i can create this query? Im sure its pretty easy to do but I have gave it a shot and cant manage to figure it out

    many thanks, Mark
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Does it have to use IF, because it looks like a simple SELECT ...WHERE query?.
    Code:
    SELECT 'quantity ordered' FROM table 
    WHERE 'quantity in stock level' < 'quantity re-order level'

    Comment

    • pv003220
      New Member
      • Jun 2010
      • 5

      #3
      hi code green

      thanks for taking the time to reply. I am a beginner at this kind of thing and dont really understand what your trying to write. Do I just copy all of that you wrote down into the criteria field under "quantity ordered", or should i be changing other settings?

      thanks, Mark

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        That is the structure of the SQL query.
        Replace the names inside the quotes with the correct field names but remove the quotes.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32668

          #5
          I would suggest replacing the quotes with brackets []. You need to be very precise about what the fields are actually named too. These are not descriptions, but names after all.

          Does this answer your original question? Do you have further need for clarification?

          Comment

          Working...