Re: System Function that will give you current Saturday Date
Posted in 2004
"N" <N@N.COM> wrote in message news:<162Gb.1989$SO5.986@newssvr29.news.prodigy.com>... > Hi All, > Is there a system function in Informix that will > give you a current specific date of a week (specifically > current Saturday). > > IDS 9.4 > Dynix/Ptx 4.5.3 > > Thank you ALL select current, current + ( 6 - weekday( current ) ) units day next_saturday, current - ( weekday(current) + 1 ) units day last_saturday from systables where tabid = 1 ; This is simple enough you can change it for other days. 0 Sunday, 1 Monday, 2 Tuesday, 3 Wednesday, 4 Thursday, 5 Friday, 6 Saturday You can derive "simple" formulas for all of the days of the week. Next Monday is current + ( 6 - weekday( current - 2 ) ) units day next_monday, I think. And you are welcome.