find times between 5 pm and 7 am (inclusive) from a date time field
360275Aug 31 2011 — edited Aug 31 2011I'm trying to find all patient appointments scheduled between between 5PM and 7AM. This is for any day. The field appt_date is a date field.
I tried: AND TO_CHAR(APPT_DATE,'HH24:MI:SS AM') >='17:00:00' AND TO_CHAR(APPT_DATE,'HH24:MI:SS') <='07:00:00'
and that leaves out patients with vists at 7AM.
I tried AND TO_CHAR(APPT_DATE,'HH24') between '7' and '17' - knowing it would include too many, but it still does not work.
Any recommendations?
Edited by: br**** on Aug 31, 2011 7:29 AM