I am trying to run a query that will sum some revenue data and then just have the sum populate a textbox. I keep getting an error of Type Mismatch in Saleslogix. I am currently running 7.5.1.
Here is the code that I am using:
strSQL = “Select SUM(Revenues) TotalRevenue from sysdba.ACCOUNT_REVENUE where ACCOUNTID = ‘”& strVal &”‘ AND FISCALYEAR = ‘”& strYear &”‘”
objRS.Open strSQL, objSLXDB.Connection
if objrs.eof = false then
If objRS.Fields.Item(“TotalRevenue”).Value > 0 then ——- This is where the system is giving me the error message.
txtTotalRevenue.Text = objRS.fields.item(“TotalRevenue”).Value
txtTotalRevenue.Text = “0.00”
Change the FormatType of the textbox to ftCurrency.