Help with access Query
-
have 2 tables: Table A: code | name Table B: barcode | name Table B has full barcode and name, Table A has only code. I need to run update query that fill name in Table A. I tried something like: update A set name = (select top 1 Name from B where B.Code = mid(A.Barcode,1,8)) but it doesn't work.
-
have 2 tables: Table A: code | name Table B: barcode | name Table B has full barcode and name, Table A has only code. I need to run update query that fill name in Table A. I tried something like: update A set name = (select top 1 Name from B where B.Code = mid(A.Barcode,1,8)) but it doesn't work.
update A set name = (select top 1 Name from B where B.barcode = mid(A.code,1,8))
Does that work any better? :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
-
have 2 tables: Table A: code | name Table B: barcode | name Table B has full barcode and name, Table A has only code. I need to run update query that fill name in Table A. I tried something like: update A set name = (select top 1 Name from B where B.Code = mid(A.Barcode,1,8)) but it doesn't work.
and that is one more reason why giving appropriate names to everything is important. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
-
update A set name = (select top 1 Name from B where B.barcode = mid(A.code,1,8))
Does that work any better? :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
'mid' is not a recognized built-in function name.
-
'mid' is not a recognized built-in function name.
Then you will need to find out what built-in function does string extraction and replace 'mid' with that function name. It probable that the parameters will be different to. :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]