How about this (not tested):
<?php
$c = $modx->newQuery('modTemplateVarResource');
$c->select('id, contentid, value, CAST(value AS DECIMAL(5,2)) AS cvalue');
$c->where(array(
'tmplvarid' => 18,
'cvalue:>=' => 7.5,
));
$collection = $modx->getIterator('modTemplateVarResource',$c);
foreach ($collection as $object) {
$output .= 'ContentId: '.$object->get('contentid').' Value: '.$object->get('value') . '<br>';
}
return $output;
Can you let me know if this works too:
<?php
$c = $modx->newQuery('modTemplateVarResource');
$c->select('id, contentid, value');
$c->where(array(
'tmplvarid' => 18,
'CAST(value AS DECIMAL(5,2)):>=' => 7.5,
));
$collection = $modx->getIterator('modTemplateVarResource',$c);
foreach ($collection as $object) {
$output .= 'ContentId: '.$object->get('contentid').' Value: '.$object->get('value') . '<br>';
}
return $output;