This is a migrated thread and some comments may be shown as answers.

Conditional Format on Date Values

1 Answer 646 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 12 Mar 2012, 08:06 PM
I have a report that show due dates. When a due date is within a certain amount of days, I need the report to format the date in a red font. Example:

Item X due date is 2012-04-01 is with in 90 days of today (2012-03-12) so the report will need to show it in a red font
Item Y due date is 2012-08-01 is not within 90 days so the font should be black.

I tried to compare dates using   = Fields.due >=DateAdd("d", 90, now()) but I get an error has occurred while processing textbox The expression contains undefined function call DateAdd()

1 Answer, 1 is accepted

Sort by
0
Accepted
Elian
Telerik team
answered on 13 Mar 2012, 01:38 PM
Hello Andy,

Is DateAdd() a custom function that you've created? If so, you have to keep in mind, that 90 will not be integer when passed, it will be object. You can use the CInt() function to convert it to an integer.
An alternative expression would be =Fields.due >= Now().AddDays(CDbl(-90)).

All the best,
Elian
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Andy
Top achievements
Rank 1
Answers by
Elian
Telerik team
Share this question
or