Automating a Find and Replace.

  • Thread starter Thread starter TekWarrior
  • Start date Start date
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.
 
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.
 
Back
Top