I am offering $20 to the first person that responds with a correct working answer to this Access query.
I have attached a file example.? I have 2 tables, I have to create a query that works out the cost of a patients stay.
If the patient's admission date is null then of course the cost of stay is zero.
If there is no discharge date then assume they are still patients and cost of stay is worked out until Date() - whatever date the query is run.
If there is both Admission Date and Discharge Date then work out cost of stay based on these dates against costs in BedCost table.
EG: I am expecting PatientName John? (ID4) to be around 43700 for his cost of stay.