Results 1 to 5 of 5

Thread: Now I know!

  1. #1
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    44

    Unanswered: Now I know!

    I've been trying to find a match between two tables by using SID as criteria.

    So anyway, first table has the following input mask: 000\-00\-0000;;_

    so it appears like this: xxx-xx-xxxx
    so the original format that is stored is like this: xxxxxxxx

    while the other table SID field format is like this: xxx-xx-xxx
    what I mean, that the numbers were entered with dashes into the db.

    so is there anyway to fix table2 by removing the dashes?

    let me know what you guys think..

    thanks

    p.s. By the way, I know how to use function (trim) in php to get rid of things like that.. but is there another way? if anyones knows ASP function that would do that...that would be great...
    or some intense update query that will fix that..

    thanks
    Last edited by kicker22; 07-01-04 at 16:22. Reason: about php..

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    In MS-SQL, you could use:
    Code:
    UPDATE myTable
       SET myColumn = Replace(myColumn, '-', '')
    -PatP

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713
    In Oracle:

    UPDATE Table2 SET sid=REPLACE(sid,'-','');
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  4. #4
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    44

    yep it worked

    thanks guys...
    I am new into DB field, and I am learning every day from you guys..

    I guess my networking experience has no use in DB

    Morad

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The two skills (networking and database management) are pretty much unrelated, other than the network has to work before the database can communicate over it.

    Kind of like carpentry and plumbing. The plumbing doesn't work well without the carpentry. That doesn't mean that I want a carpenter doing my plumbing, or a plumber doing my carpentry. While the skill depend on each other, they are NOT interchangable!

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •