I need to store a filed in a variable if one condition is met, and reference that fiield if another condition is met. The table name is billing.
Service Date 1 Sub Item
01/01/2010 0
01/01/2010 1
02/05/2010 2
02/23/2010 3
01/12/2010 0
02/23/2010 1
The ones that hae sub item 0 are charges and the others are payments. If it is a 0 I need to print the service date 1. if it is anything else I need to print the date from the preceeding 0 row. I was thinking I would store the date from the 0 row when it is read so it would always be set to the correct date and print the variable if it is anything over 0. I can't for the life of me get this to work.
This is what I have now adn it is giving me the wrong date and only on the ones the are > 0 so it is like this
blank
01/01/2010
02/02/2010
02/23/2010
blank
02/23/2010
WhilePrintingRecords;
DateTimeVar srvdate;
if {Billing_Detail.Sub Item} = 0 then
{Billing_Detail.Service Date 1};
srvdate := {Billing_Detail.Service Date 1};
if {Billing_Detail.Sub Item} > 0 then
srvdate;
if I leave off the last if statement it print the date of the actual row and not the one from the 0 row.