I am using the following statement to replace address abbreviations. I would like to expand this to look at multiple abbreviations which would be replace with the same word (ex: ST, ST., STR would all be replace with STREET). Right now I have indivisual statements for each abbreviation. - UPDATE Address SET Address.PHYSICAL_ADDRESS = Replace([PHYSICAL_ADDRESS]," ST "," STREET ")
-
WHERE (((Address.[PHYSICAL_ADDRESS]) Like "* ST*"));
10 2002
You just need to nest your replace functions in each other. - Replace(Replace(someString, abbrev1, replace1), abbrev2, replace2)
Should I also nest the Where statement?
You can't nest a where statement; it's not a function. Use an OR to combine the two filters.
I updated the query to: - UPDATE Addresses SET Addresses.PHYSICAL_ADDRESS = Replace(Replace([PHYSICAL_ADDRESS], " DR", " DRIVE"), " DRV", " DRIVE")
-
WHERE ((Addresses.[Physical_Address] Like "* DR*" or Like "* DRV*"));
I am getting a Syntax error on the "Where" statement saying that I am missing an operator. I thought "Like" was the operator.
Please use code tags when posting code.
You're correct, Like is an operator. That means you need to give it two operands. You only have one operand in the second like. - Addresses.[Physical_Address] Like "* DR*" or Addresses.[Physical_Address] Like "* DRV*"
On a side note, I'm not sure you want to replace " st" because "123 stanton st" becomes "123 streetanton street". The same applies to your dr.
Thank you, it is working now. I agree with you regarding " ST" and " DR". Not sure how I am going to handle that yet. It would be easy if I could guarantee that there was a space after, but I know there 8 times out of 10 there is not.
Well if there's no space after it, what's after it? A period I assume. Just use two replacements, one for " st " and one for " st. "
The "st" is usually at the end of the line so it it not followed by any characters.
There are also many street names that start with ST, like St Mary Ave or even St John St without a period at the end of either. Do you think the use of "Last" would be useful in this situation?
If it's not followed by anything, you can append a space to the end yourself. There's not much you can do about st mary st unless you were willing to learn and use regular expressions. I don't know what you mean by last, I'm not aware of any such function. If you mean replace just the last occurrence, you could do that.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jimmy Tran |
last post by:
Hello,
I am doing a bmw tracking project for school using asp and access2000.
on my search.asp page, I can search for a particular bmw and order it if
i want. It works fine when i do select query...
|
by: Chris Hall |
last post by:
The records in my database are displayed in a form as follows:
%>
<form action="report-ammend1.42.asp" method="post"name="form">
<table border=1>
<%
x = 1
|
by: DelphiBlue |
last post by:
I have a Nested Datagrid that is using a data relations to tie the parent
child datagrids together. All is working well with the display but I am
having some issues trying to sort the child...
|
by: Profetas |
last post by:
Hi,
Nested statements helps to generate complex source code,
what is the nesting limit that you normally consider?
I know that the Halsted and McCabe analyses can define the acceptable
level,...
|
by: solidsna2 |
last post by:
Hi,
I am relatively new to SQL. I am using SQL 2000. I am trying to
Update a field base in a criteria in a scond table.
UPDATE Tbl1
SET Tbl1.Row2 = '1'
WHERE Tbl1.Row1...
|
by: cover |
last post by:
I have an input form that passes data when submitted to a second form
to let the user know what they have just entered into the db.
My question comes with using 'update'. I'd like to query the...
|
by: arthy |
last post by:
Hi,
Is it possible to execute multiple statements on to the database using a single dbconnection object.what is the drawback in using .If not possible ,then how can the execution of multiple...
|
by: nanoman |
last post by:
Hello,
I've got a Nested Set structure in MySQL 4 here with
- id
- lft
- rgt
- parent_id
- root_id
I wrote some test scripts and i discovered that the Nested Set (the
|
by: Chris H |
last post by:
Greetings,
I'm trying to update an address field with "standard" abbreviations so
that I can do a comparison of various accounts to one another on the
address. I can update a set of records for...
|
by: matthewaveryusa |
last post by:
Hi,
This is a simple question.
How do I get statements that are nested (so like an if statement inside an if statement) to have the little +/- button so I can collapse it?
thanks,
Matt
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |