Recent content by turkishgold

  1. T

    Pairwise queries...?

    That's close but not quite....but I only care about the Samples that have BOTH of those parameters on the same date (shown by the third SQL statement I posted)...I'd like to replicate the results of running those three separate SQL statements by only having to run one SQL statement. I created a...
  2. T

    Pairwise queries...?

    I can see where you're going, but the logic in this example relative to the actual tables as I've described them from my understanding of SQL won't work: - QW_Field_Result does not have a DT_TM field, so a.DT_TM won't work - QW_Field_Sample does not have a Param or Result_Value field, so the...
  3. T

    Pairwise queries...?

    OK, in addition to my last post, these three separate SQL statements get me what I want. What I was hoping was a way to integrate these together (and to not have to create whole new full tables) into one query: SELECT r.Sample_ID, s.DT_TM, r.Param, r.Result_Value INTO Temp FROM...
  4. T

    Pairwise queries...?

    Yes, there is only one Parameter column that contains many different parameter codes - it represents the particular water quality parameter for the result value in each row/record. Something similar to this might be an "Automobile" table that contains a single field called "Make", which has a...
  5. T

    Pairwise queries...?

    I would like fields from both the sample table and result table returned in the query results: the sample ID, the parameter code, the site ID, and the Date/Time. Is there any way to do it w/o just sorting/grouping the results? As in only returning the records that meet the criteria of having...
  6. T

    Pairwise queries...?

    Not quite, I didn't give quite enough detail... the Parameters (in your example, mydefiningkeys a and b) and the DATES fields are in the same tables, respectively. It's a normalized structure with a table called Sites, which has a 1:n relationship with the Samples table, which has a 1:n...
  7. T

    Pairwise queries...?

    Hi, I'm trying to figure out how to do what I guess you would call a pairwise query, where for example you have a column called Parameter that contains various codes for water quality parameters. Then, you have a column in the Access General Date format for Dates those parameters were sampled...
  8. T

    SubQuery to narrow down data for duplicate value quality control

    Hi, OK - I tried breaking out the 2nd nested query by instead running it as initial query to get those results, and then putting those in a table. Conceptually, that's what I wanted to do in my initial trial - get this smaller set, then run the rest of the original nested query which does work...
  9. T

    SubQuery to narrow down data for duplicate value quality control

    Hi, thanks much for the response. SO, are you saying that I should pull this 2nd subquery out: (Salinity.result_value In (Select Salinity.result_value From Salinity WHERE Salinity.distributing_agency = 6) so that I have the query I mention below that works, and then the above query? I guess...
  10. T

    SubQuery to narrow down data for duplicate value quality control

    Hi, I'm trying to devise a query which will result in showing records based on result values that equal another distributing sources result values. So, I want to select the result values from the table from a particular "agency", and then based on that subquery, use that to narrow down the...
  11. T

    Multiple Nested IN SubQueries - Access 2003

    thanks, that one worked. so was just missing the [collecting_agency] and [sample_id] field form the GROUP BY part?
  12. T

    Multiple Nested IN SubQueries - Access 2003

    Yeah, the nested one does not work. It throws an error then highlights the GROUP keyword. I had this query originally which someone else generated which does work: SELECT Sample.site_id, Sample.dt_tm, Sample.collecting_agency, Sample.sample_id FROM Sample WHERE (((Sample.site_id) In (SELECT...
  13. T

    Multiple Nested IN SubQueries - Access 2003

    just tried this, no luck: SELECT Sample.site_id, Sample.dt_tm, Sample.collecting_agency, Sample.sample_id FROM Sample WHERE ((Sample.site_id) In (SELECT [Sample.site_id] FROM [Sample] INNER JOIN Sites ON Sample.site_id = Sites.site_id WHERE ((Sites.site_comments = "in") GROUP BY...
  14. T

    Multiple Nested IN SubQueries - Access 2003

    Yeah i corrected it back in the query form and still no luck. Not sure why it got cut out, i'm having some weird goings-on with my copy/pasting but, the code you see here is what I'm trying now: SELECT Sample.site_id, Sample.dt_tm, Sample.collecting_agency, Sample.sample_id FROM Sample WHERE...
  15. T

    Multiple Nested IN SubQueries - Access 2003

    Thanks - changed that, but still no joy: SELECT Sample.site_id, Sample.dt_tm, Sample.collecting_agency, Sample.sample_id FROM Sample WHERE (((Sample.site_id) In (SELECT [Sample.site_id] FROM [Sample] INNER JOIN Sites ON Sample.site_id = Sites.site_id WHERE ((Sites.site_comments = "in") GROUP...
Back
Top Bottom