Urgent Request: Remove Chars From Phone Field
Aug 3, 2006
Hi everyone -
I need to remove the formatting characters
from the phone field in the database.
The data entry scrubber did not perform correct,
and now, a LOT of records have the ( in the field.
Is there a quick way to remove the ( from the field in the database??
MSSQL 2000
thanks
tony
View 1 Replies
ADVERTISEMENT
Sep 10, 2001
I have a phone number field.
I would like to remove the hypens and brackets.
Do anyone know of any functions, I can use to accomplish this??
Thanks in advance!
--Vic
View 1 Replies
View Related
Apr 5, 2007
Hello,
I need to strip out all alpha chars and spaces in a given field and return only the numbers.
I've tried =CInt(Fields!Info.Value) and get an unexplained error. If the data was formatted consitantly I could simply do a RTrim or Right, but the number strings are not the same, some have spaces as in phone numbers (1 800 555 1212) or don't have a leading 1. Most instances are correct for my purpose (8005551212).
Any help would be appreciated.
UPDATE: Using the Replace function =Replace(Fields!Info.Value, " ","") gets me almost there. Now I should be able to use a Right, 10 function to return my desired value. Is it possible to combine these two funtions together?
View 4 Replies
View Related
Mar 13, 2001
I have a field name call firstname and other field middleinit, now the table contains data. and i want to extract data, the firstname field sometimes contains the middle initial, for for example JOHH D.
now I would like to set the firstname field with JOHN only and and set the middleinit field like D only
thanks
View 2 Replies
View Related
May 8, 2008
Hi,
I'm trying to create a case function for home phone ,work phone and cell phone. The thing is some of the home phone numbers either null, zero or less than 10 digits then i'd like to get either cell phone or work phone if they are not null, zero or less than 10 digits.
I'd appreciate it if you could help me on this?
Thanks in advance.
View 19 Replies
View Related
Jul 9, 2000
I have a column of phone numbers that have formatting such as (xxx)xxx-xxxx,
or xxx.xxx.xxxx or xxx.xxx-xxxx; however, not all phone numbers are formatted in this fashion. I need to remove all characters and only leave behind numeric digits to look like xxxxxxxxxx. I have tried select replace(colname,'-','') from table. This does the trick but does not actually change the values in the column. Any help in accomplishing this would be helpful. Thanks in advance.
Paul
View 1 Replies
View Related
Mar 1, 2014
How to remove non alpha chars from a column ?
I googled the following code
Create Function [dbo].[RemoveNonAlphaCharacters](@Temp VarChar(1000))
Returns VarChar(1000)
AS
Begin
[code]....
View 9 Replies
View Related
Oct 23, 1999
Is there any way to print variables more than 255 from ISQL on DOS
eg:-
DECALRE @Var1 (255)
DECALRE @Var2 (255)
SELECT @Var1 = 'a long line of 255 chars' -- a long line of 255 chars
SELECT @Var2 = 'a long line of 255 chars' -- a long line of 255 chars
-- I wish to print
PRINT @Var1+@Var2 -- that is 510 chars
-- (i dont wish to use SELECT @Var1+@Var2)
any body???
thanks in advance
domini
View 2 Replies
View Related
Feb 21, 2006
Hello,
I have a phone number field with the format (123)-456-7890 I need to convert this to 1234567890 formats while I am retrieving data from the table. How can I do this?
View 4 Replies
View Related
Feb 1, 2007
What's the maximum number of characters that varchar field will take? I read somewhere that it's 8k, but I may have misunderstood.
I have to potentially store 100k+ chars in a field.
What's the best way to do this?
Thanks,
--PhB
--PhB
View 1 Replies
View Related
Jan 17, 2005
Hi,
I need to formate one of my phone number field in SQL. now the data in the field is: 1234567890. I would like to formate the number to 123-456-7890. Does anyone know how to do this? Thanks.
Nicole
View 5 Replies
View Related
Jul 22, 2004
I tried searching forums for the last hour and could not find much.
Rather then doing...
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(RE PLACE(ISNULL(PHONE, ''), ' ', ''), '(', ''), ')', ''), '-', ''), '.', ''), ':', ''), '+', '')
I was hoping there was an equally efficient alternative that utilizes PATINDEX('%[^0-9]%', PHONE)
to some capacity (i.e. uses regular expressions to strip all non-numeric characters from the phone field)
I am certain this has been addressed before, just not sure if the "REPLACE to the nth degree" is the only solution.
THANKS!
View 7 Replies
View Related
Feb 1, 2006
I need to strip some puntcuation from any field in a given table.I'd rather like to avoid using the replace () for each field in thetable.Anyone have a nifty way do this?Is there a special name that I can use in the replace that means theentire row?(other than syntax, something like REPLACE(@ROW,CHAR(39),'') )tiaRob
View 1 Replies
View Related
Jul 20, 2005
Hi there - I would like to share this strip of code with our SQL 2000DBA community. The code below strips all non-numeric characters from agiven string field and rebuilds the string. Very simple, but I had tobuild it from scratch due the lack of info on this specific matter. Iam sure there are better solutions out there, although I will be gladif this script can help anyone. Feel free to modify and comment itback.Regards,Rubem Linn JuniorMCSE, .NET developerWeb Apps Specialist------------------------------------------------------- BEGIN---------------------------------------------------DECLARE @String_Length AS INTEGER -- Length of the given stringDECLARE @Original_String as NVARCHAR(50) -- The field to stripnon-numeric charsDECLARE @counter as integer -- simple counter variableDECLARE @Stripped_String as nvarchar(50) -- The field after beenstripped-- Get the length of the field (string) to be parsedSELECT @String_Length = len(someStringField) FROM SomeTable WHEREFilterID = 001-- Get the field (string) to be parsedSELECT @Original_String = someStringField FROM SomeTable WHEREFilterID = 001-- Set counter variable to 1SELECT @counter = 1-- Reset this variableSELECT @Stripped_String = ''-- Initiate loop from 1 to the Length of the given stringWHILE (@counter) <= @String_LengthBEGIN-- Check if the char in the lap is numericif substring(@Original_String,@counter,1) LIKE '[0-9]'BEGIN-- Load this variable with the non-numeric-- data stripped from the original stringselect @Stripped_String = @Stripped_String +substring(@Original_String,@counter,1)END-- Increment the counter by oneselect @counter = @counter + 1END-- Print the original string with all charactersPRINT @Original_String-- Print the numeric data that was stripped outPRINT RTRIM(LTRIM(@Stripped_String))
View 1 Replies
View Related
Oct 18, 2006
Hello,
I have a table in SQL Server 2000 which has few triggers. When I try to update a record in that table, I get following message:
Warning: The table '[TABLE_NAME]' has been created but its maximum row size (17275) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
where the data I am updating is well less than the field limit. The triggers are stored in syscomments table and when I dropped these triggers, the update statements were executed without this message. Is there anyway I can change the data type of field text in syscomments from nvarchar to ntext?
Thanks
Din
View 1 Replies
View Related
Feb 5, 2002
Say I have a column called 'NAME' in a table called 'CLIENT' and the values in NAME are Surnames or company names like:
NAME
----------------------
1-FOR-ALL
A.B. SMITH (TOOLS LTD)
BROWN
THOMSON
VW CAR SALES
I want my select to return the first 3 characters, excluding special characters (only characters between 1 and z).
In example, the following would be returned for the data above:
NAME
----------------------
1FO
ABS
BRO
THO
VWC
View 1 Replies
View Related
Feb 11, 2002
Say I have a column called 'NAME' in a table called 'CLIENT' and the values in NAME are Surnames or company names like:
NAME
----------------------
1-FOR-ALL
A.B. SMITH (TOOLS LTD)
BROWN
THOMSON
VW CAR SALES
I want my select to return the first 3 characters, excluding special characters (only characters between 1 and z).
In example, the following would be returned for the data above:
NAME
----------------------
1FO
ABS
BRO
THO
VWC
View 1 Replies
View Related
Jan 9, 2008
Hi All
I have loaded some data to the application using flat files
which has non english chars.
all the columns in the database are NVARCHAR type.
but in db and in application UI, the non english chars are being diplayed as junk chars. ???121
The application supports UTF-8 format
is there any setting at db level to be modified to display the non english char set as is.
Thanks
View 2 Replies
View Related
Aug 27, 2007
Hi,
I am very new to using SSIS.
Trying to import data from MS Access 2000.
I receive the error "
[OLE DB Destination [1907]] Warning: Truncation may occur due to inserting data from data flow column "GENDER" with a length of 255 to database column "GENDER" with a length of 2. " on the source flow.
I have done some googling and came up with this post: http://torontosql.dotnetnuke-portal.com/Default.aspx?tabid=32233 which I thought may help, but it does not.
The query against the access datasource features the column: iif([sex]=1, 'm', 'f'). I tried using left(..., 2) as well, but SSIS is determind to treat the field as 255 characters for some reason.
I don't even particualrly care that the field is 255 chars and the sources is only two, I just want the data in! I have other fields coming up with similar error.
Can someone please advise?
PS, what is th significance of the "External Columns" Vs "Output Columns" on the Input and Output Properties tab in Advanced Editor?
I am really struggling with SSIS, it is not as intuitive as DTS.
View 1 Replies
View Related
Feb 20, 2002
I cannot see to find how to uninstall SQL 6.5 client from a users PC..
Please can somone advise..
Many Thanks
Darren
View 1 Replies
View Related
Apr 2, 2008
Hi All,
Is there any way to remove the My Subscription,Site Setting links on the main page in Report manager.And also our client wants SSRS reports to be seen by his customer over the internet.Anybody knows about this?
Any help will be appreciated.
Thanks
Anupama
View 9 Replies
View Related
Mar 20, 2008
I have a Tandem (HP) SQL database that I am linking to through an ODBC connection using Access 2003.
I want to remove the literal "#" from a field. STE # 101 should be STE 101. The # is a pattern for a number. How do I remove an actual "#" ?
I am trying to find the ones with an # in it by using Like "*#*".
thanks,
Frank
View 10 Replies
View Related
Mar 17, 2004
Is there any way to remove tabs from text fields? I see tabs at the end when I import the data in Excel.
Appreciate any help
View 1 Replies
View Related
Feb 15, 2008
I have two columns COLUMNA & COLUMNB
They both store date & time. In COLUMNA, I would like do delete the time, in COLUMNB, I would like to delete the date.
They are stored like this YYYY-MM-DD HH:MM:SS
View 5 Replies
View Related
Feb 23, 2008
I get this error message when I try to connect to Reporting Services via the Management Studio.
I can see my machine listed in the Server Name > Browse For More > Local Servers dialogue. But no luck,
Ive tried:
Servername: localhost
Servername: DED1774 (the machine name)
Servername: localhost/reportserver
Servername: DED1774/reportserver
Servername: http://ded1774/reportserver (from the rsreportserver.config file
<UrlRoot>http://ded1774/reportserver</UrlRoot>)
I've Googled the error message and found postings for solutions, but none of these helped. Can anyone suggest some simple steps I can take to try to find the issue and get the connection working?
Thanks
View 3 Replies
View Related
Mar 10, 2014
in our database is saved by 6 decimal places, whether the value has no values ??in decimal position. Field type is of type nvarchar.
How do I remove these "laggards spirit" in the best and smartest way.
Ex:
100.000000 will be 100
100.001000 will be 100.001
100.000001 will be be 100.000001
100.100000 will be be 100.1
and so on...
View 3 Replies
View Related
Oct 24, 2007
I have a field that contains some text. Each field will have none or atleast one comment in it. A comment can be a string of any length with *** on both sides. Ex: ***comment***
Declare @Test_tbl Table(TextField Text)
Insert Into @Test_tbl
Select 'Some text ***comment*** some more text' Union all
Select 'Other text ***another comment*** more and more text' Union all
Select '***Comment*** some text ***More Comments***' Union all
Select 'some text with no comment'
I need the output be ...
TextField
--------------
Some text some more text
Other text more and more text
some text
some text with no comment
Thanks in advance.
View 4 Replies
View Related
Jun 30, 2015
I have two linked tables from two different databases, there is a column "product" on each table however the product on one table has a Prefix so not a direct match. How can I join these tables ? In the query I have used product2: Replace([scheme_pos.product],"-B","") then tried Joining on product2 but it says JOIN not supported.
View 2 Replies
View Related
Jun 12, 2007
I am trying to write a user defined function that will allow me tostrip off the last carriage return and line feed from a text field.We have address fields stored in a text field for our ERP system andsome of them have an extra carriage return and line feed at the end ofthem. This causes havoc when we sync between our ERP system and CRMsystem. If anyone knows a way to solve this problem the help would beappreciated.Examples:Existing Text field with CR:1234 Blah Street<CR>Suite 2345<CR>Corrected Text field:1234 Blah Street<CR>Suitr 2345
View 4 Replies
View Related
Sep 8, 2015
I am querying with a SELECT statement against an address table that has a post code column with corrupt data.
Sample record:- Northants NN4 0NB
Should be NN4 0NB
I have used the following on another column:-
LEFT(A.Addr1,CASE WHEN CHARINDEX ('(', A.Addr1) =0 THEN LEN(A.Addr1) ELSE CHARINDEX('(' ,A.Addr1) -1 END) AS 'Address 1'
but unable to correct this problem?
View 9 Replies
View Related
Mar 22, 2001
I have a 'notes' field. Entries in there are time-stamped as well. so lines
looks sort of below...
01/01/2001 10:00 am
Called him. Sent him some info.
03/01/2001 2:00 pm
Nice guy. Fun talking
etc
Is there a SQL function/way by which I can grab entries from 'notes' field by date ?
Thanks a lot in advance.
Derek
View 1 Replies
View Related
May 26, 2000
hi all,
i am having a problem. In my table i have defined a logtime field as a datatype datetime. Now i want to query the table on a particular date which is not possilbe i supposed. so how can i break the datetime field into date field. Is there any method.... I don't want to create the table once again.
manish
View 2 Replies
View Related
Sep 25, 2000
I need to expand the size of one column which has been defined as varchar(32) to varchar(50).Is this possible?Already there are many old records in the table,in what way it will effect the old records?Any help is appreciated.
Thanks!!
View 2 Replies
View Related