I just solved this but I will leave for prosperity.
The data names through the scripting must match in capitalization too.
I corrected the minHigh and maxHigh to MinHigh and MaxHigh. Yay! I travel on.
My question is 'Is this thread answer indicative of all column aggregations?'
I have a need for min(High) and max(High). I have a sql SELECT min(High) minHigh, max(High) maxHigh FROM pricing Where Close < 300.01 and Close > 49.99 limit 100
The limit controls the possibility of receiving data that fits well within the range, i.e. Highest value could be 286.00 while the lowest value could be 56.00.
Table sql is
CREATE TABLE [pricing] (
[Company] TEXT NULL,
[Symbol] TEXT NULL,
[Open] FLOAT NULL,
[High] FLOAT NULL,
[Low] FLOAT NULL,
[Close] FLOAT NULL,
[Volume] FLOAT NULL,
[Industry] TEXT NULL,
[Sector] TEXT NULL
);
An ORM
using SimpleSQL;
public class MinMaxPriceReturn
{
[Default("0")]
public float MinHigh { get; set; }
[Default("0")]
public float MaxHigh { get; set; }
}
With script
string sql = "SELECT min(High) minHigh, max(High) maxHigh " + //No 'AS'
"FROM pricing " +
"Where Close < " + queryOpenHigh +
" and Close > " + queryOpenLow;
Debug.Log("SQL Statement: " + sql);
List<MinMaxPriceReturn> minMaxPriceList = dbManager.Query<MinMaxPriceReturn>(sql);
minMaxPriceCopy = minMaxPriceList;// Copy the list, dont know why...
Debug.Log("minMaxPriceCopy.Count: " + minMaxPriceCopy.Count);// This is the list command not the data)
foreach (MinMaxPriceReturn sqlrecords in minMaxPriceCopy)//The data is pulled from copy
{
Debug.Log("HighMin: " + sqlrecords.MinHigh);
Debug.Log("HighMax: " + sqlrecords.MaxHigh);
}
debug.log reports 0 for both even thought the min is .0001 and the max is 12,000 in the table.