Sorry I didn't explain it properly.
I am after a SQL SELECT statement such as this
select sum(b.CustomValue) as PropertyValue from paapl_Ventrian_PropertyAgent_CustomField a INNER JOIN paapl_Ventrian_PropertyAgent_PropertyValue b ON a.CustomFieldId = b.CustomFieldId where a.[name]='price' and (b.CustomValue IS NOT NULL ) and a.moduleid in (875,379,476,385) and (ISNUMERIC (cast(cast(b.CustomValue as varchar) as real)) <> 1)
The problem is that the CustomValue field is a ntext field, cannot be convered to a decimal or numeric data type for addition. Also I need to run a filter on the CustomValue field to exclude non numeric values. Can you please suggest a way to get the total property value? I simply want to add up sale prices of all properties and display it.
Thanks. |