Clean up values

L

Legacy 15162

Guest
I had to link a file using a fixed width. It was the only viable solution at the time. Unfortunately this leaves some text that I need removed from my values. there are spaces and a | in the columns that I want to return. The field name currently is Plan Sales:[Field14]. How can I get rid of these spaces and | ? I need to just see the monetary value.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Can you post a couple of samples of the data so we can see the format of it?

peter

Ps. What version of Access are you using?
 
Upvote 0
Field 14
$230.34| <-- note the preceding spaces
$123.99| <---- note the pipe

I believe we are on 2000
 
Upvote 0
I dont have Access 2000 to check on but I think that this will work.
Sales: trim(Replace([Field 14],"|",""))
If you need to force it into a curency data type then you can stretch it a bit further
Sales: CCur((Trim(Replace(Replace([Field 14],"$",""),"|",""))))

HTH

Peter
 
Upvote 0
Undefined function 'Replace' in expression......Should I write a VBA function, or does access have one built in that I am just missing?
 
Upvote 0
It could be a reference problem or the fact that I have A97 and A2002 on this machine. I will try it tonight at home where I have A2000.

Peter
 
Upvote 0
I have just tried it at home and it runs fine on A2000 here with no extra references selected.

Possiblly you have A97 which dosent have the 'replace' function.

I am not back to work to Tuesday now so maybe someone else can help with code that will work in A97

Peter
 
Upvote 0

Forum statistics

Threads
1,221,625
Messages
6,160,908
Members
451,677
Latest member
michellehoddinott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top