Hello,

I'm writing a query to produce a final report based on the number of days product stays on the floor with the following logic:

1) if datediff between r and s for the same ctrl# is < = 5 then the charge is 0 and the remaining balance (if any) is a subject to a charge

2) if datediff between r and s for the same ctrl# is > 5 then r is subject to a charge and any s > 5 is ignored

sample data set below, suggestions would be greatly appreciated!

## Iterate the rows in the datagrid and compare it with the systemclock

Hi,

How would I iterate the rows in the datagrid? The 4th column contains the time, I would like to compare it with the systemclock and enter "ACTIVE" in the 5th column if the time value in the 4th column is equal to the system clock?

I tried FOR EACH.. but I can't get it right.. Please help.