We have 3rd party software that has a SQL database and we use crystal reports for reporting. The way their software is setup, leaves an audit trail, so when a record is deleted it doesn't remove it from the database, it just gives it a "1" under the deleted column for that particular table. So for our report, we want to show the carrier a shipment is being taken by, it will only look at the first row in the database even though it has a 1 as deleted when we would want the first or all choices that have a 0 as deleted. I created an IF statement kind of like this:
If deleted = 0 Then
column data
Else
"text"
But it will only look at that first row and then go to the else. We have a particular one that the carrier was deleted twice and a third added in so basically first two rows have a deleted column = 1 as being deleted and the third a 0 as not deleted but my If statement only sees that first row is deleted and goes directly to the else. Is there an easy way to change my if statement that it will throw some kind of loop to check all rows?
If deleted = 0 Then
column data
Else
"text"
But it will only look at that first row and then go to the else. We have a particular one that the carrier was deleted twice and a third added in so basically first two rows have a deleted column = 1 as being deleted and the third a 0 as not deleted but my If statement only sees that first row is deleted and goes directly to the else. Is there an easy way to change my if statement that it will throw some kind of loop to check all rows?