Sql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joel

    #1

    Sql


    Hi,

    I finally figured the problem I just need a solution! The field is defined
    as Cust_# when I run the sql statement 'Select * From Arcustom Where Cust_#
    = 35' I get the error message: Unknown column Cust_#. If I redefine the
    field as CustNumber then it works. Is there a work around?
    (I don't want to redefine the field!)

    PS Cust_# is the primary key.

    Joel


  • Bill Karwin

    #2
    Re: Sql

    Joel wrote:
    [color=blue]
    > Hi,
    >
    > I finally figured the problem I just need a solution! The field is defined
    > as Cust_# when I run the sql statement 'Select * From Arcustom Where Cust_#
    > = 35' I get the error message: Unknown column Cust_#. If I redefine the
    > field as CustNumber then it works. Is there a work around?[/color]

    MySQL permits you to use special characters in table and field names if
    you enclose them in backticks (`). For example:

    SELECT * FROM Arcustom Where `Cust_#` = 35

    Read this page for more information:
    http://dev.mysql.com/doc/mysql/en/Legal_names.html

    Regards,
    Bill K.

    Comment

    • Joel

      #3
      Re: Sql


      Your a Genius!!! Thanx!!!!

      "Bill Karwin" <bill@karwin.co m> wrote in message
      news:cl6hg802uh r@enews3.newsgu y.com...[color=blue]
      > Joel wrote:
      >[color=green]
      > > Hi,
      > >
      > > I finally figured the problem I just need a solution! The field is[/color][/color]
      defined[color=blue][color=green]
      > > as Cust_# when I run the sql statement 'Select * From Arcustom Where[/color][/color]
      Cust_#[color=blue][color=green]
      > > = 35' I get the error message: Unknown column Cust_#. If I redefine the
      > > field as CustNumber then it works. Is there a work around?[/color]
      >
      > MySQL permits you to use special characters in table and field names if
      > you enclose them in backticks (`). For example:
      >
      > SELECT * FROM Arcustom Where `Cust_#` = 35
      >
      > Read this page for more information:
      > http://dev.mysql.com/doc/mysql/en/Legal_names.html
      >
      > Regards,
      > Bill K.[/color]


      Comment

      Working...