How to match two dates
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
How to match two dates
I need to match a datetime field (from the dictionary) with a fixed date. Eg. MyDateFromDictionary >= "20111020". Script report is in C#.
Thank you.
Thank you.
How to match two dates
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
How to match two dates
Sure. In my datasource i have a datetime column called "MyDate". In its field of the report, if "MyDate" is between two specific dates (eg. 01/01/2011 and 31/01/2011) i must print "x", else i must print "y".
I don't know how to create the IIF statement to see if the "MyDate" column is between the two fixed dates (i have tried several ways but with errors).
Thank you.
I don't know how to create the IIF statement to see if the "MyDate" column is between the two fixed dates (i have tried several ways but with errors).
Thank you.
How to match two dates
Hello.
Thank you.
Please, try to use variables. See attached report template.Fabio wrote:Sure. In my datasource i have a datetime column called "MyDate". In its field of the report, if "MyDate" is between two specific dates (eg. 01/01/2011 and 31/01/2011) i must print "x", else i must print "y".
I don't know how to create the IIF statement to see if the "MyDate" column is between the two fixed dates (i have tried several ways but with errors).
Thank you.
- Attachments
-
- 1374.Report.mrt
- (21.1 KiB) Downloaded 210 times
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
How to match two dates
My intention was to write, in the field, the fixed value of the date, example:
{MyDate>"20111031" && MyDate<"20111001"?'Y':'X'}
but this raises the compilation error:
"Unable to apply operator "<" to operands of tpye "System.DateTime" and "string"."
This is correct, because the two operands are different: i have tried to convert one type to another but i have had other errors. So at this point i need to know how to convert the date in string or the string in date.
Thank you.
{MyDate>"20111031" && MyDate<"20111001"?'Y':'X'}
but this raises the compilation error:
"Unable to apply operator "<" to operands of tpye "System.DateTime" and "string"."
This is correct, because the two operands are different: i have tried to convert one type to another but i have had other errors. So at this point i need to know how to convert the date in string or the string in date.
Thank you.
How to match two dates
Hello.
Fabio wrote:My intention was to write, in the field, the fixed value of the date, example:
{MyDate>"20111031" && MyDatenew DateTime(2011,10,31) && MyDate < new DateTime(2011,10,01)?'Y':'X'}
Thank you.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
How to match two dates
I have tried, in a group footer, the following expression:
{Sum(Movimento.Movimento__Data_documento> new DateTime(2010,01,01) && Movimento.Movimento__Data_documento< new DateTime(2012,12,31)? 1 : 2)}
but the following error appears:
"The name "newDateTime" does not exists in the current context" (Note 1: i have translated the message from Italian - Note 2: in the error message, "newDateTime" appears without spaces).
Thank you.
{Sum(Movimento.Movimento__Data_documento> new DateTime(2010,01,01) && Movimento.Movimento__Data_documento< new DateTime(2012,12,31)? 1 : 2)}
but the following error appears:
"The name "newDateTime" does not exists in the current context" (Note 1: i have translated the message from Italian - Note 2: in the error message, "newDateTime" appears without spaces).
Thank you.
How to match two dates
Hello,
Please send us your report with test data for analysis.
Thank you.
Please send us your report with test data for analysis.
Thank you.
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
How to match two dates
Thank you, Fabio.