There's no built-in function for weekday, but besides a calendar you might do a simple calculation, e.g. this will return monday as 1:
REPLACE FUNCTION day_of_week(cdate DATE)
RETURNS BYTEINT
SPECIFIC day_of_week_date
RETURNS NULL ON NULL INPUT
CONTAINS SQL
DETERMINISTIC
COLLATION INVOKER
INLINE TYPE 1
RETURN ((cdate - DATE '0001-01-01') MOD 7) + 1
If you can't create SQL UDFs simply use the calculation as-is.
There's only one recommended qway to write a time literal: TIME '18:00:00'
Similar for dates: DATE '2013-07-21' and timestamps: TIMESTAMP '2013-07-21 18:00:00'
There's no built-in function for weekday, but besides a calendar you might do a simple calculation, e.g. this will return monday as 1:
REPLACE FUNCTION day_of_week(cdate DATE)
RETURNS BYTEINT
SPECIFIC day_of_week_date
RETURNS NULL ON NULL INPUT
CONTAINS SQL
DETERMINISTIC
COLLATION INVOKER
INLINE TYPE 1
RETURN ((cdate - DATE '0001-01-01') MOD 7) + 1
If you can't create SQL UDFs simply use the calculation as-is.
There's only one recommended qway to write a time literal: TIME '18:00:00'
Similar for dates: DATE '2013-07-21' and timestamps: TIMESTAMP '2013-07-21 18:00:00'
Dieter