Query Problem

Results 1 to 2 of 2

Thread: Query Problem

  1. #1
    Randy Guest

    Default Query Problem

    I am trying to access several fields from several tables in an Access database, but am getting errors no matter what I try in the SQL statement. I got this query directly from Aceess and changed a couple of things to be readable by html:<BR><BR>"SELECT 00COMMUNITY.FY00_Q0026SortofEasy AS T00, 99COMMUNITY.FY99_Q0026SortofEasy AS T99, 98COMMUNITY.FY98_Q0026SortofEasy AS T98, 97COMMUNITY.FY97_Q0026SortofEasy AS T97, 96COMMUNITY.FY96_Q0026SortofEasy AS T96 FROM 00COMMUNITY INNER JOIN (96COMMUNITY INNER JOIN (97COMMUNITY INNER JOIN (98COMMUNITY INNER JOIN 99COMMUNITY ON 98COMMUNITY.CODE = 99COMMUNITY.CODE) ON (98COMMUNITY.CODE = 97COMMUNITY.CODE) AND (97COMMUNITY.CODE = 98COMMUNITY.CODE)) ON 96COMMUNITY.CODE = 97COMMUNITY.CODE) ON 00COMMUNITY.CODE = 99COMMUNITY.CODE WHERE 00COMMUNITY.CODE = " + Replace(rsOutcome2__varCODE, "&#039;", "&#039;&#039;") + ""<BR><BR>________________________________________ ___________<BR><BR>The variable varCODE will get a value from a form on a previous page. I know the Query is long, but can anyone see why I am getting the error: "Syntax error (missing operator) in query expression &#039;00COMMUNITY.FY00_Q0026SortofEasy&#039;."<BR> ???<BR><BR>Thanks<BR>Randy

  2. #2
    Join Date
    Dec 1969

    Default RE: Query Problem

    Try using ampersands (&) instead of the plus + sign and see if that works.<BR><BR>Also, you may want to create a view or query in your database, possibly even a stored procedure to run that query from the db directly, then pass it the values it needs<BR><BR>mj

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts