Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL, genxtab, and 3 months of 4 months data
Message
From
27/07/1999 16:31:38
Shane Gilbert
Oklahoma State Department of Education
Norman, Oklahoma, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00246830
Message ID:
00246850
Views:
12
>>I wrote a program to report on 4 months of data, I use genxtab to create the tabulate the data and then run a report. It worked great until someone decided to run the report before all the data has been entered. The last month is august and hasn't happened yet. Now the genxtab program leaves out that month since it doesn't exist, and my final SQL statement to combine all the data before running the report bombs. This is in FPW26 by the way. Is there a way to use a union to select 0 for the months without data? or some other solution that escapes me? Thanks,
>>
>>Shane
>
>You couldn't just rerun the query that selects the data genxtab uses? I do not understand why the problem would be permanent since genxtab sends the output to a table name specified by a passed parameter.
>
>You could try something like the following to get a list of unique months that have data --
>
>select year(DateField) as nYear, month(DateField) as nMonth from sometable group by nYear, nMonth
>
>Other than that, I am confused as to what exactly the problem is or why it has become a problem.

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,

Shane
--Shane
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform