>I just tried to put the code snippet in question in a separate prg and it worked,(but the original did not).
>
Try separating each piece as a separate function - would be easier to debug. Also, as I said, if you're using dates for your parameters, give them the appropriate names. lcDate is confusing as it assumes variable of a character type. You don't have to use the lType prefix, but if you do, use it correctly in case someone else is going to look at this code later.
>>I'd suggest that if you have cut this piece of code that works out of a larger routine that isn't working you must be setting something that causes that in that larger routine.
>>
>>Why dont you put the code back and then start removing the selects you have before the problem one and keep testing it till it stops working.
>>
If it's not broken, fix it until it is.
My Blog