Formula Date problem

This is an IT workflow app that needs a view to give techs a heads up when something has a due date of the next day (mon - fri work days only). Below is the view selection code I’m using (status fields just relate to if it is “assigned” or “on hold” vs. being “complete”). I’m trying to account for Fridays. When it is Friday, I want to adjust the date to check for what is due the following Monday. I can’t seem to get the @If to work. Any idea what I am doing wrong? I’m also open to suggestions for a better way to accomplish this comparison of dates because if my Friday is also a month end date (e.g. Friday, 11/30/07) then does that mean this won’t work since @Adjust will only up the day value and not the month value?

Please help :slight_smile:

Thanks,

Lisa

------------ my code ----------------------------

FIELD TomorrowDate := @Tomorrow;

TomorrowDate :=

@If(@Weekday(@Today) = “6”; @Adjust(@Today; 0; 0; 3; 0; 0; 0);TomorrowDate);

SELECT (Form = “Assignment” | Form = “AS”) & (AS_StatusFlag = 1 | AS_StatusFlag = 5) & (SLA_DueDate = TomorrowDate)

Subject: Formula Date problem

I just checked using @date with @adjust and found that it will take a date of 11/30/07 and adjust it by 3 days to give me 12/03/07.

e.g. test code:

FIELD TomorrowDate := @Adjust(@Date(2007;11;30); 0; 0; 3; 0; 0; 0);

So I just need to figure out my @if statement…

Subject: Formula Date problem

@Weekday( time­date )Parameters

time-date

Time-date. The date having the weekday value you want.

Return value

weekdayNumber

Number. Weekday numbers are 1 through 7, with Sunday = 1, Monday = 2, and so on.

@if(@weekday(@today)=“6”; …)

try

@if(@weekday(@today)=6; …)

Further, adjusting a time-date (as specified) does not mean adjusting only the day…

HTH

ian

Subject: Formula Date problem

Lisa,

You’re going to have a really slow view because of these time/date sensitive formulas (@Today). If that’s acceptable, then I guess I’d write it like this:

todayNum := @Weekday(@Today);

adjustNum := @if(todayNum = 6 : 7; 3; 1);

SELECT Form = “whatever” & DueDate = @Adjust(@Today; 0; 0; adjustNum; 0; 0; 0);

hth,

raphael

Subject: RE: Formula Date problem

Raphael,

It is working!

Thank you so much!

Lisa