Your version of Oracle doesn't recognise 'weekday' because that is not an Oracle function.
You can use the to_char()
function to get a day number, but it's dependent on NLS settings, so safer not to reply on it. Day names are also NLS-language-dependent, but that can at least be overridden as part of the function call:
where to_char(OR_Log.Surgery_Date, 'Dy', 'NLS_DATE_LANGUAGE=ENGLISH') not in ('Sat', 'Sun')
The 'Dy'
format element is described in the documentation, along with all the others. Note that 'DY'
gives you the day abbreviation in uppercase, and 'Day'
or 'DAY'
give you the full day name in mixed/uppercase; but those are padded with spaces by default (as are abbreviations in other languages...); but you could add a modifier if you want the full day names for readability:
where to_char(OR_Log.Surgery_Date, 'FMDay', 'NLS_DATE_LANGUAGE=ENGLISH') not in ('Saturday', 'Sunday')