jakbo
July 12th, 2008, 09:42 AM
Hello,
How is a command field treated in Crystal Reports XI? An array? The reason I ask is because we can utilize the Count() function and it returns how many rows are in a command field (i.e. num = Count({Command.OccurenceDate})). In this scenario, we're getting the correct number of rows in this field. The problem, however, is that I need to iterate through these record in either a formula field or a custom function. How would one go about indexing (using subscripts) to do this? I'd like to be able to access each record in this field directly using subscripts, but I cannot find any resources or examples showing how to do this? I can use a for loop to step through the contents of the field, but there doesn't seem to be any obvious way to index it. Something like this:
for(i=0;i<Count({Command.OccurenceDate});i++){
if(DateIWantToCompareWithTheDatesInOccurenceDate ={Command.OccurenceDate}[i])
doSomething
}
What is the syntax (either basic or crystal) to do this in a formula or custom function? I don't need the for-loop syntax, just how to use subscripts with the command field in the if statement. Any help would be greatly appreciated.
How is a command field treated in Crystal Reports XI? An array? The reason I ask is because we can utilize the Count() function and it returns how many rows are in a command field (i.e. num = Count({Command.OccurenceDate})). In this scenario, we're getting the correct number of rows in this field. The problem, however, is that I need to iterate through these record in either a formula field or a custom function. How would one go about indexing (using subscripts) to do this? I'd like to be able to access each record in this field directly using subscripts, but I cannot find any resources or examples showing how to do this? I can use a for loop to step through the contents of the field, but there doesn't seem to be any obvious way to index it. Something like this:
for(i=0;i<Count({Command.OccurenceDate});i++){
if(DateIWantToCompareWithTheDatesInOccurenceDate ={Command.OccurenceDate}[i])
doSomething
}
What is the syntax (either basic or crystal) to do this in a formula or custom function? I don't need the for-loop syntax, just how to use subscripts with the command field in the if statement. Any help would be greatly appreciated.