www.webdeveloper.com
Results 1 to 2 of 2

Thread: SQL / ASP replace character

  1. #1
    Join Date
    Jan 2011
    Posts
    60

    SQL / ASP replace character

    Hi,

    I'm currently trying to export data from an sql table to a CSV file using classic asp, this has worked absolutely fine except one column partdesc has several commas in which causes the import to CSV to start a new column, however I actually want the data to be in the same column when exporting. Is there away to replace these using the replace function either on the SQL Select statement or when I write the lines to the CSV file.

    SQL select statement

    HTML Code:
      "SELECT partmaster.partnum, partmaster.partdesc, stock.stloc FROM efacdb.dbo.partmaster INNER JOIN efacdb.dbo.stock ON partmaster.partnum = stock.stocknum WHERE partmaster.partdesc NOT  LIKE 'PG50%' AND  NOT (partmaster.partnum LIKE 'CITYLINK%' OR partmaster.partnum LIKE 'CWO%' OR partmaster.partnum LIKE 'FWC%' OR partmaster.partnum LIKE 'FWD%' OR partmaster.partnum LIKE 'RECORDED%' OR partmaster.partnum LIKE 'UPSEX%' OR partmaster.partnum LIKE 'UPSSTD%')"
    ASP write line

    HTML Code:
    LogFile.WriteLine((objRS("partnum"))&","&("")&","&("")&","&(objRS("partnum"))&","&("")&","&(date())&","&(date())&","&("0")&","&("0")&","&("0")&","&(objRS("stloc"))&","&("0")&","&("0")&","&("0")&","&("0")&","&("")&","&("RFS")&","&(objRS("partdesc")))
    Thanks

  2. #2
    Join Date
    Jan 2011
    Posts
    60
    All sorted, put a character in the wrong place.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles