By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

Creating An If Statement

P: 5
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
Jun 28 '10 #1

✓ answered by code green

Does it have to use IF, because it looks like a simple SELECT ...WHERE query?.
Expand|Select|Wrap|Line Numbers
  1. SELECT 'quantity ordered' FROM table 
  2. WHERE 'quantity in stock level' < 'quantity re-order level'

Share this Question
Share on Google+
4 Replies


code green
Expert 100+
P: 1,726
Does it have to use IF, because it looks like a simple SELECT ...WHERE query?.
Expand|Select|Wrap|Line Numbers
  1. SELECT 'quantity ordered' FROM table 
  2. WHERE 'quantity in stock level' < 'quantity re-order level'
Jun 28 '10 #2

P: 5
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
Jun 28 '10 #3

code green
Expert 100+
P: 1,726
That is the structure of the SQL query.
Replace the names inside the quotes with the correct field names but remove the quotes.
Jun 28 '10 #4

NeoPa
Expert Mod 15k+
P: 31,768
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?
Jun 28 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.