Pagenation to list selected items

hi all,
i want to display 5 orders in a page from an orders table. so i used…

i m getting startDate and endDate as parameters.

@orders_pages, @orders = paginate(:orders, :conditions =>[“ordered_on >
? and ordered_on < ?”,startDate, endDate])

if i get a collection of 15 orders, it displays first 5 order
correctly… but if i press the ‘next_page’ link it says undefined
variable startDate.

plz guide me to solve this problem…

thanks in advance.
madhan