try select * from payment as p, (select * from datelist('8/1/2005, 8/5/2005')) as date
where date...... = p.....
The problem is the function's parameters '8/1/2005', '8/5/2005' has to refer to whatever value on the payment records.
try select * from payment as p, (select * from datelist('8/1/2005, 8/5/2005')) as date
where date...... = p.....