Hi Everyone,
I have a schedule table that uses varchar2 as datatype for the fields start_time and end_time. I want to put constraints on the end_time field so that the value must be after 9:00 AM (opening time) and before 9:00 PM (closing time). Also a similar constraint for the start_time. I tried to use to_date function to convert the value so the constraint can contain a comparison clause but cannot make it work.
I suspect that it would be easier to store the fields as a date field but haven't been able to figure out how to do so. Any tips for storing such information so I can compare the time in a constraint.
Thanks,
Marc
I have a schedule table that uses varchar2 as datatype for the fields start_time and end_time. I want to put constraints on the end_time field so that the value must be after 9:00 AM (opening time) and before 9:00 PM (closing time). Also a similar constraint for the start_time. I tried to use to_date function to convert the value so the constraint can contain a comparison clause but cannot make it work.
I suspect that it would be easier to store the fields as a date field but haven't been able to figure out how to do so. Any tips for storing such information so I can compare the time in a constraint.
Thanks,
Marc