problem by subtracting the two queries

Koloss

New member
Local time
Today, 11:18
Joined
Feb 7, 2013
Messages
5
I have the following problem:
I have two tables. In the first (Baza) are:

ID
Mag_sifra
Int_Mag_Sifra
Naziv
Kolicina
Datum

In the second (Izdato) are:

ID
Mag_Sifra
Int_Mag_Sifra
Naziv
Izdato
Datum

Values Mag_Sifra, Naziv is the same in the both table. I made two queries. Query Baza and query Izdato. I want substract kolicina from first and Izdato from second. I get the following result:

14485 133 01 44 85 MANZETNA F-55/F 0 160 -160
14485 144 01 44 85 MANZETNA F-55/F 160 160 0

But i want this:

14485 133 01 44 85 MANZETNA F-55/F 0 0 0
14485 144 01 44 85 MANZETNA F-55/F 160 160 0

Where is 14485- Mag_Sifra, 133 01 44 85 and 144 01 44 85 - Int_Mag_Sifra, MANZETNA F-55/F - Naziv, first number is kolicina, second is izdato, and third is result.

Int_Mag_Šifra is the code of the place where the goods are in the warehouse. Its location. Mag_Šifra is the commodity code. Kolicina is the quantity of input goods, Izdato is the goods which have been issued.

I just have this two table and three query. Q3 = QueruBaza-CueryIzdato
 

Attachments

  • untitled2.JPG
    untitled2.JPG
    65.6 KB · Views: 84
  • db1.zip
    db1.zip
    527.9 KB · Views: 82
Last edited:
[SOLVED] problem by subtracting the two queries

I solved the problem. The problem was formatting Int_Mag_Šifra field, which was formatted as text. In order not to re-enter all the data, I created two new query and use the Val function for the Int_Mag_Sifra field. Now it works perfectly. Thanks to everyone who tried to help me.
 
Last edited:
I was about to help but as you solved it yourself then that is good.

Good luck with the project.
 

Users who are viewing this thread

Back
Top Bottom