between the first three and last four numbers. The field in question does
not include area codes. I want to strip the dashes out of the db, and
reinsert into the same field.
I'm running the following query, which obtains all records having a phone
number, some with dashes, some without.
Problem is, only the first phone number of the getRecords query gets
inserted into each record. So all my records have a phone number of 5551212
(the number of the first record). Something's wrong in the update query,
but what?
How do I solve? Or is there a better way to do this?
Thanks, Mark
======================
<!--- Get a count of the records prior to insertion --->
<cfquery name="getRecords" datasource="#REQUEST.dsnSQL#"
username="#REQUEST.dsnUID#" password="#REQUEST.dsnPWD#">
SELECT memberID, directoryPhone
FROM #REQUEST.prefix#_Members_ListBU1
</cfquery>
Query Recordcount = <cfoutput>#getRecords.recordcount#</cfoutput><br />
Processing ...
<cfloop index="memberID" from="1" to="#getRecords.recordcount#">
<cfquery name="updateRecords" datasource="#REQUEST.dsnSQL#"
username="#REQUEST.dsnUID#" password="#REQUEST.dsnPWD#">
UPDATE #REQUEST.prefix#_Members_LIstBU1
SET directoryPhone = #Replace(getRecords.directoryPhone, "-", "",
"ALL")#
WHERE memberID = #getRecords.memberID#
</cfquery>
</cfloop>
Process Complete.
======================
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

