dates and if
The problem goes like this.
I have 2 fields that represent some amount of money. (a and B )
Also there is a field that contains date (i.e. 10/01/2014) (d) .
All three are taken from SQL query.
I need to complete two more fields.
1st - if date d has already passed then I need to write down into the field the result of A - B, else 0.
2nd - if date d has already passed then I need to write down the amount of days that had passed, else "" (empty string). (Today is 21/01/2014, so I need to write "11")
I tried like this for the 1st one but it always throws errors.
[IIF(<frxDBDatasetPlApm."DATUMS"> < <Date>, <frxDBDatasetPlApm."KOPSUMMA"> - <frxDBDatasetPlApm."APMAKS_SUM">,"0.00")]
I have 2 fields that represent some amount of money. (a and B )
Also there is a field that contains date (i.e. 10/01/2014) (d) .
All three are taken from SQL query.
I need to complete two more fields.
1st - if date d has already passed then I need to write down into the field the result of A - B, else 0.
2nd - if date d has already passed then I need to write down the amount of days that had passed, else "" (empty string). (Today is 21/01/2014, so I need to write "11")
I tried like this for the 1st one but it always throws errors.
[IIF(<frxDBDatasetPlApm."DATUMS"> < <Date>, <frxDBDatasetPlApm."KOPSUMMA"> - <frxDBDatasetPlApm."APMAKS_SUM">,"0.00")]
Comments
[IIF((<frxDBDatasetPlApm."DATUMS"> < <Date>), (<frxDBDatasetPlApm."KOPSUMMA"> - <frxDBDatasetPlApm."APMAKS_SUM">),"0.00")]
if this does not work for you use the obp event of the databand to write code to set the vakue of the memos text.
I think the IIF wants single quotes, not double:
[IIF(<frxDBDatasetPlApm."DATUMS"> < <Date>, <frxDBDatasetPlApm."KOPSUMMA"> - <frxDBDatasetPlApm."APMAKS_SUM">,'0.00')]
Petter
That was it! Thanks!!!
Any ideas about the second task?