Automating a Find and Replace.

T

TekWarrior

I have a DB that needs to import a csv.

The problem is that a date/time field in the csv sometimes has incorrectly
formatted dates. It has a "." instead of "/".

I figured I could import it as text, find and replace, then export/import
again to have it in the date/time format.

I have all the automation figured out except the find and replace part.

Any ideas?

BTW I tried an "IIf("*" & "." & "*"([Scan Time]),"*" & "/" & "*",[Scan
Time])" in an update query, it wouldn't except it. Then I modified it to
"IIf("*" & "." & "*","*" & "/" & "*",[Scan Time])" and it replaced the whole
field with "*/*". So I don't think an update query is the way to go.
 
T

TekWarrior

That did it, thanks (guess I was wrong on the query not helping ;-D)

--

Thanks,
Tek


Daniel Pineault said:
Use the replace function

Replace([Scan Time], ".", "/" )

Check it out in the help file for all the details.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



TekWarrior said:
I have a DB that needs to import a csv.

The problem is that a date/time field in the csv sometimes has incorrectly
formatted dates. It has a "." instead of "/".

I figured I could import it as text, find and replace, then export/import
again to have it in the date/time format.

I have all the automation figured out except the find and replace part.

Any ideas?

BTW I tried an "IIf("*" & "." & "*"([Scan Time]),"*" & "/" & "*",[Scan
Time])" in an update query, it wouldn't except it. Then I modified it to
"IIf("*" & "." & "*","*" & "/" & "*",[Scan Time])" and it replaced the whole
field with "*/*". So I don't think an update query is the way to go.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top