We're using Crystal 8.5 here with our custom health record software... Basically it's an Access database.. FYI there are no connection issues, but I just canNOT figure out how to make it give me the report I want... I tried fiddling around with SQL in there, but though it SAYS it can use SQL, I dunno what SQL language it thinks it's using -- nothing I normally use in PHP or ASP (for SQL) seems to be recognized... rather use the Crystal language anyhow...
I tried sending it home (I only have Crystal 6.0 that came with Simply Accounting , but it won't open the file, which means I can't show you what I have so far... regardless, what I have so far doesn't work for me anyhow...
So here's the scenario:
It's accessing 2 (linked) tables: Client, Program
These are the fields I need to display...
Client - FName, LName, ID
Program - ProgType, ProgName, Status, EndDate
--Descriptions:
ProgType is either "inpatient" or "outpatient"
ProgName is one of about 40 names (eg "Preschool", "Autism", etc etc)
Status is one of several names (eg "admitted", "discharged", "cancelled", etc)
EndDate is the DATE of discharge, cancel, withdrawn, etc
Fname, Lname are (obviously) the client's names
ID is the chart number for that client.
It needs to prompt the user for a date range (got that), and should pull records according to the following criteria:
First, it needs to ONLY pull records where <Status = "discharged"> and <EndDate is within the prompted date range>
The fields for the Client table will only be used in the output and so don't need to be checked in any way... would be nice to sort them numerically by ID at the end.
It needs to pull ONLY those records matching the above criteria, AS WELL AS, the ProgName needs to be one of about 9 specific items. I got this far, but...
-- Here's where I start running into problems:
I need the query to not only pull all those records, BUT I need to figure out how to add an IF statement that works: For every record it pulls up with the above criteria, I need the query to CHECK ALL the other ProgName records (if any) attached to that ID, which also match the same ProgName list as above. If there ARE any other records attached to that ID in the table, I need it to check the Status field for each to ensure they are all NOT EQUAL to "admitted".
I've monkeyed around with If statements in there, tried while loops, etc, but I must be missing something (I'm hardly new to programming)... I'm looking for a suggestion on how I can basically make it cross-check every hit that it gets against any other records for that same ID, to ensure that there are no <Status = "admitted"> records. If there ARE any admitted ProgName's, then I want that entire ID omitted from the end report..
I hope this is clear, and I know this probably isn't a "help me program" forum, but any suggestions are appreciated!
Thank you so much!!
Dave
I tried sending it home (I only have Crystal 6.0 that came with Simply Accounting , but it won't open the file, which means I can't show you what I have so far... regardless, what I have so far doesn't work for me anyhow...
So here's the scenario:
It's accessing 2 (linked) tables: Client, Program
These are the fields I need to display...
Client - FName, LName, ID
Program - ProgType, ProgName, Status, EndDate
--Descriptions:
ProgType is either "inpatient" or "outpatient"
ProgName is one of about 40 names (eg "Preschool", "Autism", etc etc)
Status is one of several names (eg "admitted", "discharged", "cancelled", etc)
EndDate is the DATE of discharge, cancel, withdrawn, etc
Fname, Lname are (obviously) the client's names
ID is the chart number for that client.
It needs to prompt the user for a date range (got that), and should pull records according to the following criteria:
First, it needs to ONLY pull records where <Status = "discharged"> and <EndDate is within the prompted date range>
The fields for the Client table will only be used in the output and so don't need to be checked in any way... would be nice to sort them numerically by ID at the end.
It needs to pull ONLY those records matching the above criteria, AS WELL AS, the ProgName needs to be one of about 9 specific items. I got this far, but...
-- Here's where I start running into problems:
I need the query to not only pull all those records, BUT I need to figure out how to add an IF statement that works: For every record it pulls up with the above criteria, I need the query to CHECK ALL the other ProgName records (if any) attached to that ID, which also match the same ProgName list as above. If there ARE any other records attached to that ID in the table, I need it to check the Status field for each to ensure they are all NOT EQUAL to "admitted".
I've monkeyed around with If statements in there, tried while loops, etc, but I must be missing something (I'm hardly new to programming)... I'm looking for a suggestion on how I can basically make it cross-check every hit that it gets against any other records for that same ID, to ensure that there are no <Status = "admitted"> records. If there ARE any admitted ProgName's, then I want that entire ID omitted from the end report..
I hope this is clear, and I know this probably isn't a "help me program" forum, but any suggestions are appreciated!
Thank you so much!!
Dave