asp replace string on recordset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omar999
    New Member
    • Mar 2010
    • 120

    asp replace string on recordset

    im trying to replace NULL with N/A but I think I have a syntax error .. how do you replace string on recordset via classic asp

    so on objRS17and18("P rice_Band_1") should it be something like

    Replace("objRS1 7and18("Price_B and_1")", "NULL", "N/A") ??
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    you have too many quotes. Try this:
    Code:
    Replace(objRS17and18("Price_Band_1"), "NULL", "N/A")
    this will work if it contains the text "NULL", not if it is a null field. If that is the case, the best solution is use isnull in the query. Let me know if this helps.

    Jared

    Comment

    • omar999
      New Member
      • Mar 2010
      • 120

      #3
      hi Jared

      thanks for your reply. on the sql table the cell in question contains NULL with an italic font... is this a null field or is NULL actually text?

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Originally posted by omar999
        hi Jared

        thanks for your reply. on the sql table the cell in question contains NULL with an italic font... is this a null field or is NULL actually text?
        sounds like a null field. look up the sql command isnull, that allows you to replace null fields with the text you prefer at the query level. I think that's the best solution for you.

        Jared

        Comment

        Working...