day of week function
Robert Edis
robeconsult@sbcglobal.net
Fri, 4 Feb 2005 11:47:35 -0800 (PST)
I like it Robert. However not all parts of PH (e.g.
Quiz) can use the CASE statement unfortunately. I
wish it were otherwise.
Bob D. Why is the CASE statement not available across
all PH components?
Blue
--- Robert Mills
<robert.mills@windsong-services.co.uk> wrote:
> I use this define. Was told that it's quicker as the
> mod and days functions are only invoked once each. I
> also think that it looks neater ;)
>
> Define d_dow Character *9 &
> = Case Of Mod(Days(EFF_DATE),7) &
> When 0 : "Sunday" &
> When 1 : "Monday" &
> When 2 : "Tuesday" &
> When 3 : "Wednesday" &
> When 4 : "Thursday" &
> When 5 : "Friday" &
> When 6 : "Saturday"
>
> regards,
>
> Robert W.Mills
> Systems Development Manager
> Windsong Services
> (020) 8309 3604
>
>
> powerh-l-admin@lists.sowder.com wrote:
> > Here is a sample defined item that should answer
> your
> > question
> >
> > DEFINE D_DOW CHAR*9 = &
> > "Monday" IF 1 = MOD(DAYS(EFF_DATE),7) &
> > ELSE "Tuesday" IF 2 = MOD(DAYS(EFF_DATE),7) &
> > ELSE "Wednesday" IF 3 = MOD(DAYS(EFF_DATE),7) &
> > ELSE "Thursday" IF 4 = MOD(DAYS(EFF_DATE),7) &
> > ELSE "Friday" IF 5 = MOD(DAYS(EFF_DATE),7) &
> > ELSE "Saturday" IF 6 = MOD(DAYS(EFF_DATE),7) &
> > ELSE "Sunday" IF 0 = MOD(DAYS(EFF_DATE),7)
> >
> > Ken
> >
> > --- Viet Nguyen <VNguyen@wsboces.org> wrote:
> >> Please can someone tell me how to get day of
> week
> >> (Monday, Tuesday )
> >> from sysdate . I looked at dateextract but it
> >> doesn't allow for this
> >> option.
> >>
> >> Thanks
> >>
> >> Viet.
> >>
> >>
> >>
> >>
> > = = = = = = = = = = = = = = = = = = = = = = = = =
> = = =
> > Mailing list: powerh-l@lists.sowder.com
> > Subscribe: "subscribe" in message body to
> > powerh-l-request@lists.sowder.com
> > Unsubscribe: "unsubscribe <password>" in message
> body to
> > powerh-l-request@lists.sowder.com
> > http://lists.sowder.com/mailman/listinfo/powerh-l
> > This list is closed, thus to post to the list you
> must be a
> > subscriber.
>
> = = = = = = = = = = = = = = = = = = = = = = = = = =
> = =
> Mailing list: powerh-l@lists.sowder.com
> Subscribe: "subscribe" in message body to
> powerh-l-request@lists.sowder.com
> Unsubscribe: "unsubscribe <password>" in message
> body to powerh-l-request@lists.sowder.com
> http://lists.sowder.com/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you
> must be a subscriber.
>