08-19-2009 09:31 AM
I have version 11.1 and the script works great, I get all the values. Another PC with version 11.0 runs the same script and all the channels that have a datatype of Decimal in SQL server have zero as value. I am setting the channel names like this, strChnls="Channel1,Channel2,Channel3,Channel4" and populating them with the code below. if channel 1 and 2 have integers or a datatime value, or character data it pulls those values in but it sets channel 3 and 4 (decimal datatypes) to 0.
Channels = Split(strChnls, ",")
For z = 0 To UBound(Channels)AsPos =
InStr(UCase(Channels(z)), " AS ")IF AsPos > 1 THEN Channels(z) = Trim(Mid(Channels(z), AsPos+1))Channels(z) =
"[" & GroupDefaultGet & "]/" & Channels(z)Next ' z
Channels = ArrayToChannels(RowVals, Channels, 1)
Solved! Go to Solution.
08-19-2009 11:07 AM
More Info:
I found this in the 11.1 release notes.
I assume this is the problem with the Decimal datatype for SQL Server as well. I dont want to iterate through the data and populate. Is there a way to get around this without changing the datatype on the database?
08-19-2009 12:18 PM
The solution is to obvious. I don't know why I didn't just do this before I posted.
In the select statement or store proc. Whichever just 'YourRealField' = convert(real, YourDecimalField) and it works in both versions.
You may have to use round (convert(..... if appropriate.