Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query - Fill multiple record/fields

Status
Not open for further replies.

jaltang

IS-IT--Management
May 15, 2002
6
US
I have a text log file that we have imported into Access. It is basically a report and the date of each series of records is in the header of each page. The individual records do not contain the date. The date ends up in its own record in the account field.

When we used to import this file into dbase, I used the following script to read the records, check to see if the account contained the date and fill in the date field in each of the subsequent records until it found another date as follows:

select 1
use phone

set talk off
do while .T.
if ISBLANK(date)
if ("/"$account)
curdate=account
endif
replace DATE with curdate
endif
skip
enddo

I am not particularly familiar with access. I can do the query to find the records with the date, but I have no idea how to place that date in the date field in each of the subsequent records until I find another record with the date.

The fields for the table are as follows:

PIN Time Line Extension Duration Number Account Date

Your help is greatly appreciated!
 
I wouldn't use any method without some field or fields that could be used to sort the recordset/query in a specific order. I tend to think of all Access/database records as kids playing in a school yard. They are never in any particular order until the teacher blows a whistle and has them all line up.

Duane
MS Access MVP
 
I do not have much of a choice in this case. The records are in chronological order in the text file and are imported as such. The automatically generated record number/ID initially serves as an order number.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top