473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

help in MS Access query

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
6 1034
Rabbit
12,516 Expert Mod 8TB
Yes, you can use the iif to flip the sign.
Feb 27 '15 #2
Rema
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
12,516 Expert Mod 8TB
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
Rema
6
yes , they are.
it keeps giving me syntax error :(
Feb 28 '15 #5
Rabbit
12,516 Expert Mod 8TB
That usually means one of your fields or table names are spelled incorrectly. Please post the full SQL code
Feb 28 '15 #6
Rema
6
never mind :)
thx ..I fixed it
Mar 1 '15 #7

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

Similar topics

0
by: david liu | last post by:
access 2000 query: here's what i want to do. from an asp page, perform a search on a table in access. i have used sql code in the asp page itself, but i'd rather execute a query in access. i...
5
by: anthonyberet | last post by:
I work for an organisation that uses a bespoke document imaging system, the database of which is an MS sql server. We have MS Access and already use it for some querying of the database. The...
3
by: Omavlana | last post by:
Hi, How to get the value as 0 insted of NULL if there is no data found in the database for a particular column in the following Access query. select col1, col2 from tab1; If there are null...
2
by: sumGirl | last post by:
Is it possible to run an access query from the scheduler? I need to update a table in the middle of the night, and so I would like to set up a job on a machine thats on all night so I dont have to...
5
by: redstamp | last post by:
Try as I might I cannot find a way to write an access query to return a result set with the records from my database WITHOUT a certain set of values within a field. To explain, I have a table of...
3
by: Idlemind23 | last post by:
Ahoy! I'm hoping for some help on what (I believe) should be a simple task. I have a form with a button. I would like that button to have a caption with a date. That date should be pulled out...
5
by: silversubey | last post by:
I have a query that works in Access. It pulls time in a format that is understood by Quickbooks. We are upgrading our access-based program to MSDE. I have tried 3rd party converters and searched...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: uno7031 | last post by:
Help Please!!! Adding 5 Days to another Date in an access query Good Morning, Help please…. I am new to access and trying to write a query that will add 5 days between a RecDate and a...
13
by: Malungo1970 | last post by:
Hi Everyone, I'm using a code to export a query from Access to create a new Excel with 1 Sheet and Protect with password, and everything's right. Private Sub botton_Click() On Error GoTo...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.