oracle - NEXT_DAY in Crystal Reports -


is there oracle "next_day" function available in syntax crystal reports uses?

i'm trying write formula output following monday @ 9:00am if datetime tested falls between friday @ 9:00pm , monday @ 9:00am.

so far have

if dayofweek ({datetimefrommydb}) in [7,1]     or (dayofweek({datetimefrommydb}) = 6 , time({datetimefrommydb}) in time(21,00,00) time(23,59,59))     or (dayofweek({datetimefrommydb}) = 2 , time({datetimefrommydb}) in time(00,00,00) time(08,59,59)) ... 

i know can write seperate if statements different amount of dateadd each of fri, sat, sun, mon, if can keep concise lumping of these 1 prefer it. i'm going adding additional rules if datetime falls outside of business hours on other weekdays want as possible prevent becoming overgrown , ugly formula.

since there no cr equivalent know of, can cheat , borrow next_day() function oracle database. can creating sql expression , entering like:

-- sql expression {%nextday} (select next_day("mytable"."mydatetime", 'monday')  dual) 

then either use directly in formula:

if dayofweek ({mytable.mydatetime}) in [7,1]     or (dayofweek({mytable.mydatetime}) = 6 , time({mytable.mydatetime}) in time(21,00,00) time(23,59,59))     or (dayofweek({mytable.mydatetime}) = 2 , time({mytable.mydatetime) in time(00,00,00) time(08,59,59)) datetime(date({%nextday}),time(09,00,00)) 

or, even better way stuff of logic sql expression , away formula altogether.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -