Forum OpenACS Development: Comparing timestamps in oracle

Collapse
Posted by Rodrigo C on
Please, help me with this.  In a query I'am trying to compare with <= and >= the timestamps but it's not working. I'am doing it like this:
select rm.room_id, rm.room_name as name2 from rooms rm, reserve rv where rm.room_id = rv.room_id and
rv.start_time < to_timestamp($ymdhm_inicio,'YYYY/MM/DD HH24:MI') and rv.end_time > to_timestamp($ymdhm_fin,'YYYY/MM/DD HH24:MI') for example.

What i'am trying to do is to verify if a date rage is content in another date range.

Collapse
Posted by Nis Jørgensen on
It would be helpful to know:
  • The definition of the tables involved (especially the types of the fields start_time and end_time
  • The contents of the fields for some records
  • The result of the query (database error or just wrong result?)
  • A more specific description of what you are trying to do (especially if the problem is a wrong result)