Okay, it sounds like you may or may not have to use the second record.
1stPost said:
I have an Access table that has telephone call data
So the data is already in Access, and you want a query to retrieve the desired record(s).
Is this data imported as raw data or is it entered into Access via a data entry screen?
LastPost said:
For some types of transfered calls the first record contains the data for the calling number, the second record contains the data for the called number
So now it appears you have a one-to-many (1:M) relationship where you may or may not have a second record.
Typically, in a 1:M relationship there will be a foreign key. Say Call #123456 for the master table, the "primary key" on the Call master table will be 123456. The corresponding Call detail table would a different primary key for each record, but would share the same Call # 123456 as a "foreign key", thus linking the two tables together.
Now, it is still hard to invision a proper solution since we still do not know the data structure of your table or tables.
...But from what I see, it seems that you import data into a raw table, and now you are trying to retrieve the data from the raw table.
Perhaps one approach would be to "process" the raw data table. Sequentially read the table, and update "normalized" tables with the data. In this case, you would use a "level break" within the program to determine if the two (or more records) are related, or not related. This requires VBA coding and if not done, the creation of new (normailized) tables.
Another approach would be to use a query to retrieve the related records BUT to do this we need to know
how you know if the subsequent record is related to the first record. If you can easily tell us how the 1st and 2nd records are related, then this approach is do-able.
A third approach would be a combination approach -- create a function that finds the first record, then using the "level break" determines if the subsequent record is related to the first. The function would then return the requried information. This requires VBA coding.
Richard