Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I'm trying to format a text in a straight table in different colors but I cannot get it to work.
I am trying to change the colors of a date so that if a start date = today()-1 the date (2010-09-12) is written in red.
The formula I've written looks like this:
if
(((
But the result is "RGB(0,0,0)"
I've also tried to type in RGB(255,0,0) but that doesnt work either. I'm running QV version 9.00.7502.8 SR5.
Any help would be highly appreciated!
Henrik
date(START_DATE)=date(today()-1),RED(),BLACK())You should try with this
If(date(START_DATE,DD-MM-YYYY')=Date(Today()-1,'DD-MM-YYYY'),Red(),Black()) and this formula will past in text formate
Hi
It is still resulting in "RGB(0,0,0)"
Your expression looks completely messed up in my browser, but piecing it together, it looks like it's this?
=if(date(START_DATE)=date(today()-1),RED(),BLACK())
That works just fine for me. Let's start with the basics - You have a START_DATE field that's a date? You clicked on the + next to the dimension or expression, clicked on "Text Color", clicked on "Edit...", and then put that in as the expression?
Yes the start date field is formatted as a date and I've done exactly as you write. I can get the text colored if I write the formula as this: =if(date(START_DATE)=DATE(TODAY()+1),blue(),blue()) but if I wrtie it correct like this: =if(date(START_DATE)=DATE(TODAY()+1),blue(),black()) then all the text comes out black. The formatting of both the start date and the result of today()+1 should be the same.
Well, I'm not sure what to say. Here's a working example using the expression you posted that you said isn't working. I'm on the exact same version as you, so it shouldn't be a version problem.
I cannot see why this should not work in my application. I solved this though by changing the formula to this:
Now this works but it puzzles me why this works and not the original formula.