Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Syntax for missing transactions anyone?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00500297
Message ID:
00501791
Views:
21
Thanks guys but I needed to have the details in a cross tab report and I had to total up the columns and state the difference between the totals between the 2 tests. I just create fuctions in the report to keep the #'s straight and then an IIF() to print what I needed.

__Stephen

>Assuming you have 2 tables -- Patients and Tests -- you could issue:
>
>select TestID, count(*) Kount from Tests ;
>union ;
>select 0 TestID, count(*) Kount from Patients ;
>where KeyID not in (select PatientID from Tests) ;
>group by 1
>
>Also assuming there are no records in Tests with a TestId = 0. Is it possible for a patient to hae multiple tests? The sum of the results could then be more than the total number of patients.
>
>>From the Report from Hell files: I got a request to
>>
>>Are we currently reporting the # of patients that are NOT tested for something?
>>
>>Think in terms of a total # of patients =30
>>result 1 = 15
>>result 2 = 7
>>Total = 22 && Group by Total
>>NO TESTS = 8 && how do we generate this line in a SQL Statement ?????
>>Total Pt = 30 && This is will be defined in a column in the table already
>>
>>
>>This is all being done in SQL Server SP and will be reported with Crystal in a web interface.
>>
>>I just had a burst of ambition! Can you manipulate totals in Crystal reporting in the Group by footers? I find Crystal hard to manipulate probably out of ignorance.
>>
>>__Stephen
Previous
Reply
Map
View

Click here to load this message in the networking platform