>Let me describe it a different way. We process claims for a 4 month period from May, June, July, and August. I have to run a cross-tab type report for several categories for each of these months. So run genxtab on my table to get the category I need combined the right way and it spits out a cursor with 6 fields - customer,may,jun,jul,aug,xtotal. I do this several times and then combine them into one cursor for the actual report printout. The problem is that when this is done before all the claims have been entered, ie no August claims, I only get 5 fields in my genxtab generated cursor and this throws everything off. I need to somewhow get 6 fields from genxtab no matter what data is in the claims file. I could do an fcount() and then do select with 0 AS aug if the fcount() = 5 but I think there should be a better way. Thanks for your time,
>
Gotcha. You have the right idea about how you will have to handle this -- fcount(). I have a similar situation where I create a report on sub-totals by State. We deal with 5 states, so my crosstab has to have a column for each state. I use field() in a loop to make sure all states have a column in the result set. If not, I add a column using the ALTER TABLE ADD COLUMN command.
Mark McCasland
Midlothian, TX USA