Forum OpenACS Q&A: Response to Best way to select between hours?

Collapse
Posted by Dan Wickstrom on
Try something like:

select creation_user from chat_msgs where creation_date between date_trunc('days',creation_date) + '11:30:00'::interval and date_trunc('days',creation_date) + '14:30:00'::interval group by creation_user;

One thing, the between operator is inclusive of the end-points, so you might have to change it slightly if you don't want to include the end-points.