Jump to content

FMP-if and CurrentDate


This topic is 8503 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I would like to display a date on a page in red if the job is incomplete and the due date is passed the current date. Here's my code.

[FMP-If: Field:due_date .gt. CurrentDate]

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size=1 color=FF0000>[FMP-Field: due_date] </font></td>

[/FMP-If]

[FMP-Else]

<td><font face="verdana,arial,helvetica" size=1>[FMP-Field: due_date] </font></td>

[/FMP-If]

Doesn't seem to work. Any ideas?

Link to comment
Share on other sites

You need to SIMPLIFY. smile.gif" border="0

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size="1: color="#FF0000">[FMP-Field: due_date]</font></td>

[FMP-Else]

<td><font face="verdana,arial,helvetica" size="1">[FMP-Field: due_date] </font></td>

[/FMP-If]

Peace

Keith

[ April 06, 2001: Message edited by: Keith M. Davie ]

Link to comment
Share on other sites

But that won't do what I'm looking for. Your code would make everything marked done black and everything else red.

I'm trying to flag items that are not complete or "done" and their due date has been passed. So if the due date is 10 April and the status is incomplete, on 14 April the date will display black but on 9 April it will be red. If the status is "done" the date will display black no matter what the date is.

Hope this makes more sense.

Thanks Keith.

Link to comment
Share on other sites

Did you then try the reverse order of <td> lines:

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size="1">[FMP-Field: due_date] </font></td>

[FMP-Else]

<td><font face="verdana,arial,helvetica" size="1: color="#FF0000">[FMP-Field: due_date]</font></td>

[/FMP-If]

or changing the parameter:

[FMP-If: Field:status .eq. done]

<td><font face="verdana,arial,helvetica" size="1: color="#FF0000">[FMP-Field: due_date]</font></td>

[FMP-Else]

<td><font face="verdana,arial,helvetica" size="1">[FMP-Field: due_date] </font></td>

[/FMP-If]

Peace

Keith

Link to comment
Share on other sites

"I'm trying to flag items that are not complete or "done" and their due date has been passed."

Ah, I missed that. Yes, the code I was suggesting would show the due date of a job which was "in process" in red, otherwise the job's due date would be in black since we are really checking the status of the jobs in order to flag the due date by color. Now this color condition will be true whether today is (1) before the due date, (2) the due date or (3) past the due date.

If the field status does not equal "done"

display the data in field duedate in red

else (the job is done)

display the data in field duedate in black

end-if

Why would you want to show the status of a job in progress in black just because today is prior to the due date? If shown in black by that date condition, won't someone think the status is complete and therefore does not need to be worked on?

If what you really want to check are just those jobs which are past due and incomplete, then you need to do a search for just those records using those criteria - a totally different process.

You need to identify the actual goal you are attempting to achieve.

Peace

Keith

Link to comment
Share on other sites

All I'm tying to do is flag jobs incomplete and passed their due date.

The only part that doesn't seem to work is this code;

[FMP-If: Field:due_date .gt. CurrentDate]

I got it to work using another approach but it required an additional calculation field which displays a 1 if the due date is less then today and a 0 if not.

Then I used this code;

[FMP-If: Field tongue.gif" border="0ast_due .eq. 1]

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size=1 color=FF0000>[FMP-Field: due_date] </font></td>

[/FMP-If]

[FMP-Else]

<td><font face="verdana,arial,helvetica" size=1>[FMP-Field: due_date] </font></td>

[/FMP-If]

Works fine but I don't like having to add an additional field to the database.

Link to comment
Share on other sites

This topic is 8503 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.