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

help in MS Access query

P: 6
hi everyone
I am making a MS Access program for inventory..
I need help in making a query for
sum the incoming materials
and outgoing materials !!
should i use (iif) statement ??
so if the transaction type is (in) , it return the amount field , and if the transaction type field is (out) it return (amount * -1 ) ?
then sum the all amounts ??
Feb 27 '15 #1
Share this Question
Share on Google+
6 Replies


Rabbit
Expert Mod 10K+
P: 12,430
Yes, you can use the iif to flip the sign.
Feb 27 '15 #2

P: 6
I tried , but it did not work :(
iif([orderDeta!trans]= "in";[det!qy];[det!qy]* -1);
Whats the wrong ?
Feb 27 '15 #3

Rabbit
Expert Mod 10K+
P: 12,430
Is orderDeta and det the table names? The delimiter for function arguments are commas, not semicolons.
Expand|Select|Wrap|Line Numbers
  1. iif(orderDeta.trans='in',det.qy,det.qy* -1)
Feb 27 '15 #4

P: 6
yes , they are.
it keeps giving me syntax error :(
Feb 28 '15 #5

Rabbit
Expert Mod 10K+
P: 12,430
That usually means one of your fields or table names are spelled incorrectly. Please post the full SQL code
Feb 28 '15 #6

P: 6
never mind :)
thx ..I fixed it
Mar 1 '15 #7

Post your reply

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