Register   Login
     
  Latest Posts  
RE: Location Search
by rodneyjoyce on 12/02/2008 2:25 AM
RE: Lightbox not working on 2.04?
by wallacea on 12/02/2008 12:31 AM
RE: Lightbox not working on 2.04?
by smcculloch on 12/02/2008 12:20 AM
RE: Facebook-like Tagging People in Pictures...
by swebster on 12/02/2008 12:13 AM
Lightbox not working on 2.04?
by wallacea on 12/01/2008 11:45 PM
News Article css
by daviking on 12/01/2008 7:04 PM
RE: File Expiration Date
by jcochran on 12/01/2008 6:35 PM
RE: Set default value
by mariusm on 12/01/2008 6:29 PM
New Module - File Search
by jcochran on 12/01/2008 6:21 PM
RE: Display Name
by blob150 on 12/01/2008 3:07 PM
  Forums  
Subject: How to obtain the total property value?
Prev Next
You are not authorized to post a reply.

Author Messages
Oz Property ListingsUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:35

9/19/2008 5:44 PM  

Hi,

I am just wondering how to obtain the total property value using a SQL statement?

Thanks.

Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12548


9/20/2008 8:18 AM  
What is total property value, a custom field?

Scott McCulloch
Site Administrator
Oz Property ListingsUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:35

9/20/2008 5:03 PM  

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.

Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12548


9/22/2008 7:13 AM  
convert it to a varchar first, then to a numeric value

Scott McCulloch
Site Administrator
You are not authorized to post a reply.
Forums > Modules > Property Agent > How to obtain the total property value?



ActiveForums 3.7