Search results

  1. F

    Handling large temporary tables

    I have a database split into a frontend and backend. The front end has several make-table queries that create tables of data on which pivot tables and other analyses queries are based. The make-table queries get re-run every now and then as new data get entered. The resulting tables are huge...
  2. F

    Comparing data across records and returning value

    Just wanted to reply to say, once again, your query worked great. Much thanks.
  3. F

    Comparing data across records and returning value

    Hope I'm not wearing out my welcome. Just suddenly facing a lot of tricky queries that are boggling my mind. Any advice or tips much appreciated. I have data on surgeries. A patient goes in and gets one or more metal implants. I also have a flag to indicate his first surgery. If the patient...
  4. F

    Associate records based on date values

    Outstanding! That worked great. The last query still returned the original records for the complications, so I tweaked it slightly to remove those. Much thanks. I just posted a similar question with similar data here...
  5. F

    Crosstab query with two column headers

    I have data like so, in a junction table between tblPatients and tblComplications: PtID PtCompID Complication CompDate 1 1 CompABC 1/2/05 1 2 CompXYZ 5/2/05 2 3 CompABC 3/2/10 2 4 Comp123 3/2/10 etc.I need it restructured like so...
  6. F

    Associate records based on date values

    I have data like so. This is from a junction table that creates a many-to-many between tblPatients and tblEvents. PtEventID is the PK, PtID is a FK to tblPatients, and EventID is a FK to tblEvents. (I'm showing Event to make it easier to understand.) PtEventID PtID EventID Event...
  7. F

    Crosstab to convert row value into column

    They are normalized. For example: tblSubjects stores info on the subject (e.g., SubjectID, Name) tblQuestions stores info on the questions (e.g., QstnTXT) tblAnswers stores possible answers for each question. tblResponses stores info on actual responses (e.g., RspnsID, Rspns) etc. What I'm...
  8. F

    Crosstab to convert row value into column

    I have a survery database with data stored accordingly: tblSubjects stores info on the subject (e.g., SubjectID, Name) tblQuestions stores into on the questions (e.g., QstnTXT) tblResponses stores info on the responses (e.g., RspnsID, Rspns) I use a query to pull together data from all three...
  9. F

    Find earliest date by group

    Well done! That works. Very much appreciated. Thank you.
  10. F

    Find earliest date by group

    That's the workaround I had come up with. I was hoping though to handle it all in one query using the subquery idea you sauggested in your first reply. May not be possible, though. But thank you for the for the suggestions.
  11. F

    Find earliest date by group

    Strange - your query works with the sample data I provided, but it didn't work with the data I've attached (which includes just a few more records from a hypothetical PatientID 3). PatientID 3 has three checkup visits. Instead of selecting the earliest one, the query selects two of them. I can't...
  12. F

    Find earliest date by group

    I have a junction table that stores patient visits (a patient can have 1 or more visits, and a visit type can be associated with 1 or more patients). For example: PtVisitID PatientID VisitType VisitDate 1 1 Checkup 7/1/10 2 1 Checkup 3/3/10 3...
  13. F

    Transform some rows to columns

    Figured it out. Turned out to be quite simple. Solution attached. Basically: 1. Create a select query to pull the data together. Include in it a calculated field, MergedVar, with this formula: IIf([QstnType]="SelectAll",[QstnBrief] & "_" & [Rspns],[QstnBrief]) AS MergedVarr SELECT...
  14. F

    Transform some rows to columns

    I can use a simple query that shows survey responses like so: SubID QstnBrief Rspns -------------------- 1 Gender Male 1 Color Red 1 Color Blue 1 Color Orange -------------------- 2 Gender Female 2 Color Blue -------------------- etc. Gender = What is you...
  15. F

    Challenge with select query to limit records

    You're correct. PatientID is not necessary in that table. These worked great. (I adjusted them a bit so they don't use PatientID.) The query returns the results immediately. Thank you!
  16. F

    Challenge with select query to limit records

    Just wanted to say this worked, but there's a bit of a performance issue. tblVisitsDevices has about 4,000 records. qryRemoved returns 1700 records, and qryNotRemoved returns 650. qryNotRemoved takes about 30+ seconds to run. Things will get worse over time as more records get returned. Any...
  17. F

    Challenge with select query to limit records

    I have a table that tracks changes made to patients' hearing aids (DeviceID) over the course of several doctor visits. In the example below, the patient was given two hearing aids (DeviceID 4 & 5 were "Added") at Visit 1. On Visit 2, DeviceID 5 was repositioned, on Visit 3 it was recalibrated...
  18. F

    table structure to document patient medications

    I'm building a database that needs to document details about patients' medications (name, dose, etc.). The client is interested only in 10 specific medications that he's identified ahead of time. Initially I planned to create a many-to-many between tblPatients and tblMeds, and use a continuous...
  19. F

    Append query with multiple criteria not working

    Good idea. And your code worked. Thanks.
  20. F

    Parse open args into three strings

    I think the three openargs values will always be there: two of them reference values on the form (which will always be there) and one is a word hard coded into the openargs statement. But just in case, how would I check that (x) = 2? Something like: If X < 2 Then ' exit Else ' run code End If
Back
Top Bottom