Removing Commas From a field

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Removing Commas From a field

    Hello I have 2 fields that are name the same in different tables. One is called
    : ProductGrade.GradeID and the other is
    Parts.GradeID.

    now my problem is this I need a way to link these two tables however the
    Parts.GradeID has some of the entries typed in like this:

    3,4

    is there a way for me to get them to be like this instead

    3
    4

    if i can then I would be able to compare the tables like this Parts.GradeID =
    ProductGrade.GradeID I can't right now because they do not equal each other..

    thanks for the help

    mactech999 Guest

  2. Similar Questions and Discussions

    1. Removing paragraph mark in a field
      Hi all I need some help please I am trying to remove the pragraph marks ^p in a text field called - advert.DescriptionDetails when...
    2. Counting commas in string
      Does ColdFusion have a function that counts a certain character in a string?
    3. Removing characters out of a field
      I have a search screen and the user will be entering an isbn number to search. Some users will enter dashes and others will not. My database field...
    4. DataFormatString shows currency, but without commas
      Hi, How do I get the commas into my datafield if it is a currency. I am dealing with hundred thousands, so it would really help out the user if...
    5. Commas Missing.
      Hello everyone, I have a table with a column for real estate property values. The format of the column is float(8,2). When the results are...
  3. #2

    Default Re: Removing Commas From a field

    Normalize your database. Then you won't have problems like this.
    Dan Bracuk Guest

  4. #3

    Default Re: Removing Commas From a field

    You need a database redesign. If Parts.GradeID is supposed to be the foreign
    key to the GradeID field in ProductGrade, i.e. it's the "link" that joins the
    two tables, then it's designed incorrectly. Each field should hold one
    discrete piece of information, not a list. Lists don't cut it for normalized
    relational DB design, and you're going to drive yourself crazy trying to work
    around this flaw.

    philh Guest

  5. #4

    Default Re: Removing Commas From a field

    yeah the only problem with that is we have a program that need the information
    that way with the commas in the field... so i'm looking for a work around I
    know there are ways just need to find one.

    if anyone has any ideas other than redoing the database please let me know..

    thanks

    mactech999 Guest

  6. #5

    Default Re: Removing Commas From a field

    Change the program as well.
    Dan Bracuk Guest

  7. #6

    Default Re: Removing Commas From a field

    lol wish i could but we can't
    mactech999 Guest

  8. #7

    Default Re: Removing Commas From a field

    Look for another job.
    Dan Bracuk Guest

  9. #8

    Default Re: Removing Commas From a field

    Your options vary hugely based on what RDBMS you are using and how the program
    accesses the database.

    The best solution is to normalize your database but create a view that the
    program accesses for its bastardized format.
    The view could even have the same name as the old table and the program would
    be none the wiser.

    Details depend on RDBMS and what else the program does.

    Just a pure workaround, with no database changes whatsoever, is short-sighted
    but possible -- depending (again) on what DB is in use.


    MikerRoo Guest

  10. #9

    Default Re: Removing Commas From a field

    you could use a loop

    <cfloop index = "ListElement"
    list = "1,2,3,4">
    <cfoutput>#ListElement#</cfoutput><br>
    </cfloop>
    1
    2
    3
    4

    jorgepino Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139