[SOLVED] Error en grid - SQL en SC version 7.01.0003

al crear un grid, se realizar una sentencia SQL: SELECT num, fecha, cantidad, precio, (cantidadprecio) AS vsubtotal FROM factura
en la cual tenemos un campo calculado vsubtotal, al ejecutar el grid me despliega un errro, en el cual indica que (cantidad
precio) es una columna desconosida, la consulta SQL la verifque en SQL Builder del SC y funciona… este problema no se ten?a en la version 6.
Por favor su ayuda urgente debido a que tengo un proyecto con muchas grid y campos calculados en la sentencia SQL.

Agradeciendo su respuesta.

error sql - grid.jpg

Hello Carlos,

Please translate your current issue to english. Otherwise I won’t be able to understand fully the issue you are facing.

Thanks,
Bernhard Bernsmann

to create a grid, you create a SQL statement: SELECT num, fecha, cantidad, precio, (cantidad * precio) FROM factura AS vsubtotal
in which we have a calculated field vsubtotal, when compiling the grid ends successful, but I run the grid displays an error, which indicates that (cantidad * precio) is an unknown column, the SQL query in the SQL Builder checked SC and it works … this problem was not with version 6.
Please your urgent assistance because I have a project with many grid and calculated fields in the SQL statement. Please review the attached

Hi Carlos,

please write (cantidad * vsucres) as vsubt, but not ‘(cantidad * vsucres)’ as vsubt … (without quotes).

the original SQL statement is:
SELECT num, fecha, year(fecha) AS vanio, month(fecha) AS vmes, mpc, mpv, (mpc*mpv) AS vsubtotal FROM facturas
and no quotes

I have other projects in version 6 and migrate to version 7.1, which similarly presents me the same error.
Perform a fresh install on another computer again and I get the same error when I generate a grid with an SQL statement with calculated field.
What I realized is that the year and month functions have no problem, I will check other MySQL functions.
Please help I have a project where a client and grids do not work!!

Yes, i can confirm the error. SC insert quotes around the calculated fields in the sql string … => [SIZE=5]Bug![/SIZE]

Curious that error … I write that sql string …

SELECT InvoiceLineId, InvoiceId, TrackId, UnitPrice, Quantity, UnitPrice * Quantity as UnitSum from InvoiceLine

… and SC 7.1.003 makes the following …

SELECT InvoiceLineId, InvoiceId, TrackId, UnitPrice, Quantity, (UnitPrice * Quantity) as unitsum from InvoiceLine

Wrong => insert quotes, unitsum must be UnitSum …

same thing happens when I run a query with the function ROUND
SELECT num, fecha, year(fecha) AS vanio, month(fecha) AS vmes, mpc, mpv, ROUND(mpv, 2) AS vsubtotal FROM facturas
ScriptCase 7.01.0003 adds quote in the calculated field ROUND(mpv, 2)

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann

Dear Please indicate the estimated date to fix the problem.
Thanks for your reply.

Good afternoon,

I proceeded to perform the upgrade ScriptCase and this problem is solved.

Thanks …