PDA

View Full Version : Solved: Help with replacing data



EricM
08-14-2005, 11:57 AM
I am currently using the following statement

Insert into hm (TestName, Folder, Alive, Dead, Average) VALUES ('%TestName%', '%Folder%', '%AliveRatio%','%DeadRatio%','%AverageReply%')

Instead of Inserting a new record I would like to replace the record where
Value (%testname%) is equal to hm (TestName).

is this possible

Norie
08-14-2005, 12:02 PM
Why not just use an Update query?

EricM
08-14-2005, 12:12 PM
cause I am not good at queries :-) Not sure how to write it

EricM
08-14-2005, 12:59 PM
Ok
I got it to accept the update query but I have one more problem. It wont add a record if it does not exist. So I would have to make sure all possible TestName would have to be in the table already. Is there a way to have a if does not exist insert else update.

All in the same query

geekgirlau
08-15-2005, 03:12 PM
You would have to do two queries: one to update the record if it exists, and the other to insert the record if it doesn't exist.