running query with the following error query1 is not a valid name. Make sure that it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TAC1
    New Member
    • Mar 2015
    • 3

    running query with the following error query1 is not a valid name. Make sure that it

    I am running a query with the following Sql
    Code:
    SELECT [DRUG CHEMICAL PROPERTIES].CODE, [DRUG CHEMICAL PROPERTIES].[DRUG NAME], [DRUG CHEMICAL PROPERTIES].[NUMBER OF RINGS], [DRUG CHEMICAL PROPERTIES].[WATER SOLUBILITY]
    FROM [DRUG CHEMICAL PROPERTIES]
    WHERE ((([DRUG CHEMICAL PROPERTIES].[NUMBER OF RINGS])=[Please enter 2 or 3 or 4]) AND (([DRUG CHEMICAL PROPERTIES].[WATER SOLUBILITY])>[Please enter water Solubility larger than 0.0211 but not greater than 0.9778]));
    and it is giving this error query1 is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long. query 1 is the name of the query
    Any ideas how can i solve this pls tkx
    Kind Regards
    thomas
    Last edited by Rabbit; Mar 23 '15, 09:40 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1288

    #2
    There is no reference to "query1" in the SQL. So obviously the problem is not in this code unless [DRUG CHEMICAL PROPERTIES] is a query that makes reference to query1.

    Tell us more. Is this a saved query or are you running this from VBA? If so, provide more of the surrounding code.

    Jim

    Comment

    • TAC1
      New Member
      • Mar 2015
      • 3

      #3
      drug chemical properties is a table where data on which query1 must run is stored

      Comment

      • jimatqsi
        Moderator Top Contributor
        • Oct 2006
        • 1288

        #4
        And where is query1? You have shown us nothing with query1 mentioned except the error.

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          Are you trying to save that query as query1? In which case, the code in the query has nothing to do with the error. I would check to see if you already have another object named query1. Or just save it with a different name.

          Comment

          • TAC1
            New Member
            • Mar 2015
            • 3

            #6
            Thanks all for your help but the problem with the query was solved and it was that the criteria contained a decimal number while it must only include whole numbers

            Comment

            Working...