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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Column with Null needs to copy record above it

Status
Not open for further replies.

snowmman99

Technical User
Jul 17, 2008
15
US
I hope this can be done. I have been trying different ways to do this and maybe somebody can steer me in the right direction.
My problem is:


I want to copy column1 lineA value of 1111 to the null vaule below it If COLUMN2 LineB = XXXX

Is this possible?

column1 column2
--------------------
(LineA) 1111 2222
(LineB) null XXXX

 

The easy answer (and probably the wrong one) is:
Code:
Update MyTable Set Column1 = 
(Select Column1 from MyTable Where Column2 = 2222)
Where Column1 Is NULL And Column2 = XXXX
What is wrong with this approach? You do not tell us HOW you get these records in the order you have shown. And I hope you talk ‘records’ and not ‘cells in Excel’ because you are in “Microsoft: Access Tables and Relationships” forum.


Have fun.

---- Andy
 
Text document I import this into a ACCESS table. I need to delete the matched expenditure and Difference and PT ORD.
I was thinking is to copy the cell above it when PT ORD is in the cell. This will allow me to delete all the records that are duplicate with PT ORD.
What do you think??
 
 http://www.mediafire.com/?z5l4ge4o63mzeal


snow,

Is this a one-shot task or an on going one?

If it's a one time deal, the file can be fixed in Excel manually.

Otherwise, I would move heaven and earth to find the source for this REPORT or the perpetrator of it. Yes, it's most likely a REPORT, and REPORT are NOT a good source for tables.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks Skip.. This will be a ongoing event each month. I used a form to manually select multiple rows and delete but would like to do it in the table. When imported it does leave null rows between each set of duplicate values. I don't know if I could do a loop and look for the duplicate value and if null and the remarks column equals "PT ORD" copy the value above.
Just how could I do it in excel prior to importing?

Wayne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top