[dancer-users] howto query between date ?

Tonton to.tonton at gmail.com
Thu Feb 13 14:04:30 GMT 2014


YES!
my $count_DossiersClos = database('asav')->quick_count(
            'DossierClos',
            {DateCloture => {
                gt => '2013-11-01 00:00:01',
                lt => '2013-12-01 00:00:01',
            }})

made good request in mysql
thanks  a lot !
T.


On Wed, Feb 12, 2014 at 5:58 PM, David Precious <davidp at preshweb.co.uk>wrote:

> On Wed, 12 Feb 2014 17:19:08 +0100
> Tonton <to.tonton at gmail.com> wrote:
>
> > hello
> >
> > i write this in my sub
> >
> > my $count_DossiersClos = database('asav')->quick_count(
> >             'DossierClos',
> >             {DateCloture =>{ 'lt' => "2013-12-01
> > 00:00:01"},DateCloture => { 'gt' => "2013-11-01 00:00:01"}});
> >                 return $count_DossiersClos;
> >
> > but the query just use the last  Date cloture and in mysql.log i read
>
> Yeah - it's a hashref and you're using the same key name twice, that
> will never work.
>
> I believe you can say:
>
> {
>     DateCloture => {
>         gt => '2013-11-01 00:00:01',
>         lt => '2013-12-01 00:00:01',
>     },
> }
>
>
> Cheers
>
> Dave P
>
>
> --
> David Precious ("bigpresh") <davidp at preshweb.co.uk>
> http://www.preshweb.co.uk/     www.preshweb.co.uk/twitter
> www.preshweb.co.uk/linkedin    www.preshweb.co.uk/facebook
> www.preshweb.co.uk/cpan        www.preshweb.co.uk/github
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20140213/682f487e/attachment.html>


More information about the dancer-users mailing list