views:

62

answers:

1

Hi There,

Is there a way to use codeigniters active record system to construct a query that will search for rows that fall between two dates (rows has an added field and I want to supply the query a start and end date)?

I have checked the documentation knowing that mysql includes a between keywork for such things but can't see anything related to it.

Thanks in advance

+1  A: 

You can just use two where() methods. They will be bound via AND, so if the first is 'everything after' and the second is 'everything before', you get a 'everything in between'.

If you want to use SQL goodies like NOW(), use where()s third parameter, and set it to False.

Boldewyn