After adding a new View using the Database Expert, I started getting the following error when running the report:
Database Connector Error: 'If tables are already linked then the join type cannot change.'
Failed to retrieve data from the database.
Error in File 04600test {FE1B1F52-937A-4372-9E11-E8220A9478FA}.rpt:
Database Connector Error: 'If tables are already linked then the join type cannot change.'
The issue seems to have been that the View was doing an Inner Join to Table A, while I was doing a Left Outer Join to the same table in the report (Database Expert).
The error disappeared after I did an Inner Join to the table in question, inside the report (Database Expert).
Wednesday, August 20, 2014
Using the SQL Round function with negative values
I had an issue where the Round finction was rounding the value '-19.395' as '-19.39'
The SQL statement was -
Select Round(((((Table.Value) * ISNULL(Table.Value, 1) * (-1))) - (Table.Value* 0.029)), 2) As Result
I was able to resolve the issue by 'casting' the value as a 'Money' data type.
Select Round(Cast(((((Table.Value) * ISNULL(Table.Value, 1) * (-1))) - (Table.Value * 0.029)) As Money), 2) As Result
With this, the value returned was '-19.40'
The SQL statement was -
Select Round(((((Table.Value) * ISNULL(Table.Value, 1) * (-1))) - (Table.Value* 0.029)), 2) As Result
I was able to resolve the issue by 'casting' the value as a 'Money' data type.
Select Round(Cast(((((Table.Value) * ISNULL(Table.Value, 1) * (-1))) - (Table.Value * 0.029)) As Money), 2) As Result
With this, the value returned was '-19.40'
Subscribe to:
Comments (Atom)