I am having trouble comparing system variables as dates. Basically I have two variables dx1c and dx10c. I need to display one of them depending on some date logic. The date logic is as follows:
if the df(date from) is before 10/01 and the dt (date thru) is after 10/1 I need to choose dx1c.
if the df is after 10/01 I need to choose dx101c
if the dt if before 10/01 I need to choose dx1c
What I have currently doesn't work. Any suggestions?
{IIF ((PoC.dt >= "10/01/2015" && PoC.df <= "10/01/2015"),PoC.dx1c, IIF ((PoC.df >= "10/01/2015"), PoC.dx101c,PoC.dx1c))}
Comparing Dates
Re: Comparing Dates
Hello.
You are trying to compare Date with string. It is not right.
Please, use next expression instead of the "10/01/2015"
You could get more information about this constructor on the MSDN Library.
Or as a way maybe it will be simpler for you to create a variable with Date type and us it in the expression instead of the "10/01/2015" string.
Thank you.
You are trying to compare Date with string. It is not right.
Please, use next expression instead of the "10/01/2015"
Code: Select all
new DateTime(2015, 1, 10)
Or as a way maybe it will be simpler for you to create a variable with Date type and us it in the expression instead of the "10/01/2015" string.
Thank you.