> >
> > No luck ... I changed the last line to
> > $c->stash->{st_record} = $choice->get_column('qcount');
> > and got the error
> > "DBIx::Class::Row::get_column(): No such column 'qcount'
>
> Hang on, your search syntax is completely wrong. You need to pass it a single
> \%attrs hashref, currently you're trying to pass two ($cnt[0] and $ords[0]) so
> it only sees the second one.
>
Thanks, that was it!
The working code:
my @conds = {
date => { '>' => '2006-06-21 11:59:59', '<'
=> '2006-06-22 11:59:59' }, sensorid => { '>' =>
'4', '<' => '9' },
};
my @cnt = {
select => [ "DATE_FORMAT(date,'%b')",
'DAYOFMONTH(date)', { count => '*' } ],
as => [ 'month', 'daymonth', 'qcount' ],
order_by => [ 'sensorid DESC' ] ,
group_by => [ 'sensorid' ]
};
my $rs = $schema->resultset('Tblsensorlog')->search(@conds,@cnt);
my $choice = $rs->first;
$c->stash->{st_record} = $choice->get_column('month');
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/