MikeCopeland
Programmer
Using CR11...
I have having great difficulty accessing specific data in a query that has many tables. No matter how I try to qualify the SQL selection, either I get too much data or I omit data I want. Here is the data:
IdNo Id Key Date1 Date2 Link
213298 288268 828117 <NULL> 12/16/2007 288335
213298 288335 829863 <NULL> 12/31/2007 0 <<-- I want this row
213298 287732 808403 <NULL> 8/13/2007 287840
213298 287978 813644 <NULL> 10/08/2007 288268
In this data set, the only link to this table is "IdNo", yet I must obtain the "Key" value of 829863 (the 2nd row shown above). There are many other rows in this table, but these (which have "Date1" = <NULL>) are the pertinent data.
If I qualify the SQL selection on "Link = 0", I get many other rows that happen to equal 0 in that column; if I select "isNull(Date1) and Link = 0", I get no data for this data set. Sorting the data on Id or Key (either Ascending or Descending) further exacerbates the problem by getting too much or too little data.
Bottom line is that I want to obtain/use the Key that's in the 2nd row here (to link to s subsequent table), and I can't find any way to select, sort, or qualify the data from this table to get it. Any thoughts? TIA
I have having great difficulty accessing specific data in a query that has many tables. No matter how I try to qualify the SQL selection, either I get too much data or I omit data I want. Here is the data:
IdNo Id Key Date1 Date2 Link
213298 288268 828117 <NULL> 12/16/2007 288335
213298 288335 829863 <NULL> 12/31/2007 0 <<-- I want this row
213298 287732 808403 <NULL> 8/13/2007 287840
213298 287978 813644 <NULL> 10/08/2007 288268
In this data set, the only link to this table is "IdNo", yet I must obtain the "Key" value of 829863 (the 2nd row shown above). There are many other rows in this table, but these (which have "Date1" = <NULL>) are the pertinent data.
If I qualify the SQL selection on "Link = 0", I get many other rows that happen to equal 0 in that column; if I select "isNull(Date1) and Link = 0", I get no data for this data set. Sorting the data on Id or Key (either Ascending or Descending) further exacerbates the problem by getting too much or too little data.
Bottom line is that I want to obtain/use the Key that's in the 2nd row here (to link to s subsequent table), and I can't find any way to select, sort, or qualify the data from this table to get it. Any thoughts? TIA