ZURINET
asked on
Select column name as prifix to row values
you can use string concatenation
example
select
'[customerID].&[' + convert(nvarchar,CustomerI D) + ']' as customerID,
'[storeID].&[' + convert(nvarchar,storeID) + ']' as storeID,
...etc ...
FROM tablename
example
select
'[customerID].&[' + convert(nvarchar,CustomerI
'[storeID].&[' + convert(nvarchar,storeID) + ']' as storeID,
...etc ...
FROM tablename
Make sure ALL of the fields you are updating are defined as text in the underlying table and Try this in VBA:
EDIT:
Sorry - I though this was posted in the Access zone... This assumes you're working with an Access interface.
Sub DoThis()
dim rs as DAO.recordset
SET rs = CurrentDB.OpenRecordset
if rs.recordcount = 0 then Exit Sub
do until rs.eof
rs.Edit
rs!CustomerID = "[CustomerID].[" & CustomerID & "]"
rs!StoreID= "[StoreID].[" & StoreID & "]"
rs!AccountNumber = "[AccountNumber].[" & AccountNumber & "]"
rs.Update
rs.MoveNext
Loop
rs.close
set rs = nothing
EDIT:
Sorry - I though this was posted in the Access zone... This assumes you're working with an Access interface.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Hars..
Thanks for the great answer!
Thanks for the great answer!
ZURINET,
Did you see the earlier post from 'sognoct' at http:#a38809246 ?
Unless I'm missing something, the answer you accepted from harshada_sonawane is identical to that earlier response...
Did you see the earlier post from 'sognoct' at http:#a38809246 ?
Unless I'm missing something, the answer you accepted from harshada_sonawane is identical to that earlier response...
SELECT 'CustomerID' & CustomerID, 'StoeID' & StoreID,......
FROM yourtable
Kelvin