[TYPO3-mvc] Query greaterThanOrEqual / lessThanOrEqual not working

Alexander Dick typo3 at dick.at
Thu Feb 9 11:27:36 CET 2012


OK forget it, problem solved.
Turned out that strtotime() converted my date string to an incorrect 
timestamp... that was the last thing I looked at.


Am 09.02.2012 11:15, schrieb Alexander Dick:
> Hi everybody!
>
> I have a listing of records, and on top of that I made 2 input fields to
> specify a date range.
>
> For that I implemented a repository method findByDate():
>
> /**
> * @param integer $dateFrom Start date timestamp
> * @param integer $dateTo End date timestamp
> */
> public function findByDate($dateFrom, $dateTo) {
> $query = $this->createQuery();
> return
> $query
> ->matching(
> $query->logicalAnd(
> $query->equals('deleted', 0),
> $query->equals('is_complete', 1),
> $query->greaterThanOrEqual('date',$dateFrom),
> $query->lessThanOrEqual('date', $dateTo)
>
> )
> )->execute();
> }
>
> the date field is of type integer and holds a timestamp.
>
> The problem is that no results are returned as soon as I add
> greaterThanOrEqual or lessThanOrEqual.
>
> I also debugged the query, and everything looks fine.
> Even when I paste it into phpmyadmin the correct results are shown.
>
> Any clues?
>
> Thanks
> Alex



More information about the TYPO3-project-typo3v4mvc mailing list