If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how can I replace SQL query with VBA logic
I have a table which looks like the following..
Sample group TestNo 29045 IG Test 1 29053 IG Test 1 29053 IR Test 1 29067 IG Test 1 29067 IR Test 1 and I need to correct my TestNo, If the sample is same and group is different then I need to assign different no, My query looks like this.. DoCmd.RunSQL "UPDATE tbl_Results set TestNo='Test 2' where group='IG' and TestNo='Test 1';" this query updates every row with IG whcih is not correct. I wan to update only if the sample is same and group is different. I want to get values of FixedNo and not ErrorNo. For this I need to use count(*) and having having count 2 but how can I do this. Is there a way to do this in VBA? ErrorNO FixedNo Test 2 Test 1 Test 2 Test 2 Test 1 Test 1 Test 2 Test 2 Test 1 Test 1 Thanks a lot -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201005/1 |
Thread Tools | |
Display Modes | |
|
|