Help with Data base!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Results 1 to 4 of 4

Thread: Help with Data base!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  1. #1
    Rich Pena Guest

    Default Help with Data base!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Can anyone show me how to change a field number to a word then post it to a database. I have the database working on the web, but the users want the number in a certain field to read as a word and not the number coming out of the database.<BR><BR>for example I am doing this:<BR>&#060;%<BR>&#039 Change The Fields numbers to Words In Database<BR>tmpCSF = RS("CSF")<BR>tmpBV1_STAT = RS("BV1_stat")<BR>tmpC1_STAT = RS("C1_stat")<BR><BR>If tmpCSF = "0" Then<BR>tmpCSF = "good"<BR>Else<BR>tmpCSF = "bad"<BR>End If<BR><BR>&#039 Do for each Block Valve 1<BR>Select Case tmpBV1_stat<BR>Case 0<BR>tmpBV1_stat = "Closed"<BR>Case 1<BR>tmpBV1_stat = "Open"<BR>Case 2<BR>tmpBV1_stat = "Stuck"<BR>Case 3<BR>tmpBV1_stat = "Problem"<BR>%&#062;<BR><BR>&#060;%<BR>End Select<BR>&#039Do for each Compressor Station 1<BR>If tmpC1_STAT = "0" Then<BR>tmpC1_STAT = "Good"<BR>Else<BR>tmpC1_STAT = "Bad"<BR>End If<BR>%&#062;<BR><BR>How do I get this to work I am stuck HELP PLEASE THANK YOU

  2. #2
    M. Seh Guest

    Default This answer might seem kind of lame

    But while I am waiting for an answer to my question, I read yours. And it seems to be a classic situation to be solved from the database end -- the table with the numbers in it would be the parent table and you would create child tables with the "word" values you want to correspond to the numbers -- and then do a select statement from both tables, something like:<BR><BR>select c.wordvalue, p.otherdata from parent p,child c <BR>where c.numbervalue=p.numbervalue<BR><BR>Otherwise, it seems that what you are currently doing, hardcoding the values to be displayed when a specific number is found in the field, seems correct.

  3. #3
    Neil Popham Guest


    check out:<BR><BR><BR><BR>give it a thorough test and come back to me

  4. #4
    Neil Popham Guest

    Default this may be more like it... oops

    sorry, i think i missed the point earlier<BR><BR>in this situation i usually use an include file with arrays<BR><BR><BR>eg:<BR><BR><BR>&#062; arrStat(0) = "Closed"<BR>&#062; arrStat(1) = "Open"<BR>&#062; arrStat(2) = "Stuck"<BR>&#062; arrStat(3) = "Problem"<BR><BR>&#062; Response.Write arrStat(tmpBV1_stat)<BR><BR>by putting the arrays in an include file you can easily reuse them<BR><BR><BR>this is obviously an ALTERNATIVE to using linked tables in the db - which i generally use if there are MANY entries. this is very useful also though<BR>

Posting Permissions

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