Sql Problem

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

    Sql Problem


    I'm selecting fields from History table (Oelsls) including Description from
    Inventory table (Invt) where Cust_# = value of PBV_lngCustomer Number.
    However I get an error: 'Unkown Table Oelsls'!! When it's there! Anything
    wrong with what I'm doing?

    "Select Oelsls.Part_ID, Invt.Desc1, Oelsls.Last_Sal e, Oelsls.Order_#,
    Oelsls.Ltd_Unit s, Oelsls.Ltd_Sale s From Oelsls, Invt Where Oelsls.Part_ID =
    Invt.Part_ID" & " And Oelsls.Cust_# = " & PBV_lngCustomer Number



  • Bill Karwin

    #2
    Re: Sql Problem

    Joel wrote:
    [color=blue]
    > I'm selecting fields from History table (Oelsls) including Description from
    > Inventory table (Invt) where Cust_# = value of PBV_lngCustomer Number.
    > However I get an error: 'Unkown Table Oelsls'!! When it's there! Anything
    > wrong with what I'm doing?[/color]

    Just a guess... Table names for MyISAM tables are case-sensitive in
    MySQL. You must match the spelling of the table name exactly.

    This might not be true on Windows, though. The reason is that MyISAM
    tables correspond directly to files on the filesystem, and UNIX/Linux
    filenames are case-sensitive, while on Windows they are not.

    Regards,
    Bill K.

    Comment

    • Joel

      #3
      Re: Sql Problem

      Thank you for responding Bill. If I run the Sql statemeny like this:

      "Select Part_ID, Last_Sale, `Order_#`, Ltd_Units, Ltd_Sales From Oelsls
      Where `Cust_#` = " & PBV_lngCustomer Number

      It works!


      "Bill Karwin" <bill@karwin.co m> wrote in message
      news:cndkg2030u m@enews3.newsgu y.com...[color=blue]
      > Joel wrote:
      >[color=green]
      > > I'm selecting fields from History table (Oelsls) including Description[/color][/color]
      from[color=blue][color=green]
      > > Inventory table (Invt) where Cust_# = value of PBV_lngCustomer Number.
      > > However I get an error: 'Unkown Table Oelsls'!! When it's there![/color][/color]
      Anything[color=blue][color=green]
      > > wrong with what I'm doing?[/color]
      >
      > Just a guess... Table names for MyISAM tables are case-sensitive in
      > MySQL. You must match the spelling of the table name exactly.
      >
      > This might not be true on Windows, though. The reason is that MyISAM
      > tables correspond directly to files on the filesystem, and UNIX/Linux
      > filenames are case-sensitive, while on Windows they are not.
      >
      > Regards,
      > Bill K.[/color]


      Comment

      • Bill Karwin

        #4
        Re: Sql Problem

        Joel wrote:
        [color=blue]
        > Thank you for responding Bill. If I run the Sql statemeny like this:
        >
        > "Select Part_ID, Last_Sale, `Order_#`, Ltd_Units, Ltd_Sales From Oelsls
        > Where `Cust_#` = " & PBV_lngCustomer Number
        >
        > It works![/color]

        Okay, maybe failing to put Order_# in backticks was confusing to MySQL,
        and it blamed it on the _next_ token it saw, which was Oelsls.Ltd_Unit s.

        Have you tried your original query using the backticks every time
        Order_# is mentioned? Be sure to quote your table names and field names
        that contain special characters.

        Regards,
        Bill K.

        Comment

        • Joel

          #5
          Re: Sql Problem

          Here's what I did:

          "Select Oelsls.Part_ID, Invt.Desc1, Oelsls.Last_Sal e, `Oelsls.Order_# `,
          Oelsls.Ltd_Unit s, Oelsls.Ltd_Sale s From Oelsls, Invt Where Oelsls.Part_ID =
          Invt.Part_ID" & " And `Oelsls.Cust_#` = " & PBV_lngCustomer Number

          I get an error: Unkown column `Oelsls.Order_# ` in 'field list`

          Any idea, Bill?


          "Bill Karwin" <bill@karwin.co m> wrote in message
          news:cndpft0t5d @enews4.newsguy .com...[color=blue]
          > Joel wrote:
          >[color=green]
          > > Thank you for responding Bill. If I run the Sql statemeny like this:
          > >
          > > "Select Part_ID, Last_Sale, `Order_#`, Ltd_Units, Ltd_Sales From Oelsls
          > > Where `Cust_#` = " & PBV_lngCustomer Number
          > >
          > > It works![/color]
          >
          > Okay, maybe failing to put Order_# in backticks was confusing to MySQL,
          > and it blamed it on the _next_ token it saw, which was Oelsls.Ltd_Unit s.
          >
          > Have you tried your original query using the backticks every time
          > Order_# is mentioned? Be sure to quote your table names and field names
          > that contain special characters.
          >
          > Regards,
          > Bill K.[/color]


          Comment

          • Bill Karwin

            #6
            Re: Sql Problem

            Joel wrote:
            [color=blue]
            > I get an error: Unkown column `Oelsls.Order_# ` in 'field list`[/color]

            Oelsls.`Order_# `

            Bill K.

            Comment

            • Joel

              #7
              Re: Sql Problem



              IT WORKED!!!!! Thanks a million Bill!!!

              "Bill Karwin" <bill@karwin.co m> wrote in message
              news:cndrka15e0 @enews3.newsguy .com...[color=blue]
              > Joel wrote:
              >[color=green]
              > > I get an error: Unkown column `Oelsls.Order_# ` in 'field list`[/color]
              >
              > Oelsls.`Order_# `
              >
              > Bill K.[/color]


              Comment

              Working...