access to mysql access [closed]

1

cordial greeting. I need to convert a query that I have in acces to pass it to mysql and I managed to convert most of the query but the mathematical operation part did not leave me and I get an error ... the query is this ..

Access query

SELECT Inventario.Referencia, Inventario.Nombre, Inventario.Existencias, transito.cantidad AS Transitos, ConsumoTotales.Consumos, 100 AS Futuro, IIf(IsNull([Consumos]),(0),Round(([Consumos]/10)*3)) AS Minimo, IIf([Minimo]>[Existencias],1) AS Alerta, IIf([Alerta]=1,Nz([Consumos],0)+[Minimo]-[Existencias]-Nz([Transitos],0),0) AS Pedido
FROM (Inventario LEFT JOIN transito ON Inventario.Referencia = transito.referencia) LEFT JOIN ConsumoTotales ON Inventario.Referencia = ConsumoTotales.REFERENCIA;

mysql query

SELECT inventario.referencia, inventario.nombre, inventario.existencia, transitos.cantidad AS transitos, total_consumo.Consumos, 100 AS Futuro, If(IsNull(Consumos),0,Round((Consumos/10)*3)) AS Minimo, If('Minimo'>'Existencias',1,0) AS Alerta  If( Alerta=1, Ifnull(cantidad,0)+ Minimo - Existencias - Ifnull(transitos,0) AS Pedido
FROM inventario LEFT JOIN transitos ON inventario.referencia = transitos.referencia LEFT JOIN total_consumo ON inventario.referencia = total_consumo.REFERENCIA; 

I appreciate if you can help me, I do not have much practice in this.

    
asked by Sebastian Lozano 20.11.2017 в 13:39
source

0 answers