Spliting Text Up And Change Name from DB

Results 1 to 2 of 2

Thread: Spliting Text Up And Change Name from DB

  1. #1
    Join Date
    Dec 1969

    Default Spliting Text Up And Change Name from DB

    Hello,<BR><BR>Here is my problem:<BR><BR>I have a details page which only displays codes for an item. So on the details.asp page I have the following codes: 3,6,9,18,29,31,43,64,83,92,98,104,105,106,109,130, 132,154,164,175,180,184,187,193,194,205,216,218,21 9,226,<BR><BR>Now, I have a table in my database that has all the codes like this<BR><BR>CODE DESCRIPTION<BR>3 DVD<BR>6 128 MB Memory<BR>9 10GIG HardDrive<BR>18 14.1 TFT Screen<BR><BR>And so on like that.<BR><BR>How would I split those numbers up and then loop them through the other table and then only display the descriptions? I am new to asp so all the help you can give me would be greatly appreciated.<BR><BR>Thanks a bunch,<BR>Ryan

  2. #2
    Join Date
    Dec 1969

    Default RE: Spliting Text Up And Change Name from DB

    Not as hard as it might look<BR><BR><BR>strSQL = "SELECT Code, Description FROM theTable WHERE Code IN (" & [codes] & ")"<BR><BR><BR>codes should be a comma separated string of the codes, just like you posted, only without the last comma.<BR><BR>This works best for Access, if you use SQL Server, there is another option...

Posting Permissions

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