Skip to main content
August 13, 2008
Answered

Hash Marks in Field Names

  • August 13, 2008
  • 2 replies
  • 439 views
Forgive me but I have forgotten how to do this.
I'm trying to pass the query field name: "Pat #" , which can't be changed.
<cfset pat_no = '#Pat ##'>
Problem is the hash mark in the field name.
I've tried:
<cfset pat_no = '#Pat #'#''>
but it errors out.
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    aliceinthemirror wrote:
    > I've tried:
    > <cfset pat_no = '#Pat #'#''>
    > but it errors out.
    >

    You escape ColdFusion control characters by doubling them. So your line
    should probably be <cfset pat_no = '#Pat ###'>

    HTH
    Ian

    2 replies

    August 13, 2008
    <cfset pat_no = 'Pat ##'> or try <cfset pat_no = '#Pat ###'> if its an actual column name - I havnt tested that one though.
    Newsgroup_UserCorrect answer
    Inspiring
    August 13, 2008
    aliceinthemirror wrote:
    > I've tried:
    > <cfset pat_no = '#Pat #'#''>
    > but it errors out.
    >

    You escape ColdFusion control characters by doubling them. So your line
    should probably be <cfset pat_no = '#Pat ###'>

    HTH
    Ian
    August 13, 2008
    Thanks for the help.
    It worked fine.
    Hope I can help you out one day.