doorbreaker
Programmer
Hi,
I am trying to run the following query but it does not work.
select sum(distinct i.quantity as VAL), i.oemnumber
from issuedstock i, so_oem_lookup s
where i.sonumber = 112
and i.oemnumber = s.oemnumber
and s.qtyneeded = VAL
group by i.oemnumber
I want to check the sum of a bunch of fields in one table against one field in another table, and if they match to display the results. This isn't working however.....
The sum of all of the quantity fields in issuedstock should match with the qtyneeded in the so_oem_lookup table.
~Can anyone see a way to do this? I've tried to use AS but I am getting nowhere.
Thanks in advance
Chris Moore
Error Message in IBConsole:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 31
as
Statement: select sum(distinct i.quantity as VAL), i.oemnumber
from issuedstock i, so_oem_lookup s
where i.sonumber = 112
and i.oemnumber = s.oemnumber
and s.qtyneeded = VAL
group by i.oemnumber
I am trying to run the following query but it does not work.
select sum(distinct i.quantity as VAL), i.oemnumber
from issuedstock i, so_oem_lookup s
where i.sonumber = 112
and i.oemnumber = s.oemnumber
and s.qtyneeded = VAL
group by i.oemnumber
I want to check the sum of a bunch of fields in one table against one field in another table, and if they match to display the results. This isn't working however.....
The sum of all of the quantity fields in issuedstock should match with the qtyneeded in the so_oem_lookup table.
~Can anyone see a way to do this? I've tried to use AS but I am getting nowhere.
Thanks in advance
Chris Moore
Error Message in IBConsole:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 31
as
Statement: select sum(distinct i.quantity as VAL), i.oemnumber
from issuedstock i, so_oem_lookup s
where i.sonumber = 112
and i.oemnumber = s.oemnumber
and s.qtyneeded = VAL
group by i.oemnumber