I am having a problem where if I apply a(n exact) formula to a field the metadata SQL generator will not apply the chosen aggregate.
In one of my table "[REPAIRS]" in my database I have a field "[REPAIR_PRICE]" which is stored as the actual repair repair price multiplied by 100 (so 25 is stored as 2500). So in my model I've got a field with the name "Repair Price" and the exact formula "REPAIRS.REPAIR_PRICE/100". If I select this "Repair Price" column in the metadata qUERY bUILDER I get this SQL -
Which works as expected. However if I try to apply an aggregation to the column I get this SQL -
When I would have expected -
The same SQL each time.
If I change the formula to "REPAIR_PRICE/100" and disable exact I get this SQL -
Which is correct except for the quotation marks.
Does anyone have any way around this issue? The DB server is MSSQL and I'm using the JNDI driver.
In one of my table "[REPAIRS]" in my database I have a field "[REPAIR_PRICE]" which is stored as the actual repair repair price multiplied by 100 (so 25 is stored as 2500). So in my model I've got a field with the name "Repair Price" and the exact formula "REPAIRS.REPAIR_PRICE/100". If I select this "Repair Price" column in the metadata qUERY bUILDER I get this SQL -
Code:
SELECT
REPAIRS.REPAIR_PRICE/100 AS COL0
FROM
REPAIRS REPAIRS
Code:
SELECT
REPAIRS.REPAIR_PRICE/100 AS COL0
FROM
REPAIRS REPAIRS
Code:
SELECT
SUM(REPAIRS.REPAIR_PRICE/100) AS COL0
FROM
REPAIRS REPAIRS
If I change the formula to "REPAIR_PRICE/100" and disable exact I get this SQL -
Code:
SELECT
SUM(REPAIRS."REPAIR_PRICE/100") AS COL0
FROM
REPAIRS REPAIRS
Does anyone have any way around this issue? The DB server is MSSQL and I'm using the JNDI driver.