Share via

ACCESS 2013, The Microsoft database engine does not recognize " as a valid field name or expression

Anonymous
2015-10-01T03:56:23+00:00

I have a report that is based on a crosstab query that counts the amount of records a person has entered.  The parameter are base on a form control [Start Date] and [End Date]. The report works as long as I don't have a start date  = or greater than 9/20. The query will work no matter what dates are entered, but the report wont open if start date is 9/20 or greater, I get the error message that the database engine does not recognize " as a valid field name of expression. The database was created in 2007 and updated to 2013, this is when I started having the problem. Help does anyone no the answer to my problem.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

14 answers

Sort by: Most helpful
  1. Anonymous
    2015-10-02T15:14:47+00:00

    You need to design your report to expect a varied number of columns since that is what a crosstab query returns.  You can't define a report based on the columns returned by your initial query trial.  The results will change as your data changes.

    Trying to output a crosstab query to a report is probably not a good idea to begin with, because your columns will most likely exceed the paper size.  If you need to output your results for others, you might find that it's easiest to export your query results to an Excel file.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2015-10-02T00:13:49+00:00

    I suspect the problem is in data entered after that date. But as Duane says we need to see the SQL behind your recordsource. Also, is your report set up for dynamic headings?

    I'm not sure what is meant by dynamic headings, but here is the SQL

    Query Parameters dialog box

    PARAMETERS [Forms]![TeamFilter]![Start Date] DateTime, [Forms]![TeamFilter]![End Date] DateTime;

    TRANSFORM Count([Performance Window Extended].[ID ENTRY]) AS [CountOfID ENTRY]

    SELECT [SPV Names].SPVNameRank, Count([Performance Window Extended].[ID ENTRY]) AS [Total Of ID ENTRY]

    FROM [SPV Names] INNER JOIN [Performance Window Extended] ON [SPV Names].ID = [Performance Window Extended].[Reporting SPV]

    WHERE ((([Performance Window Extended].[PW Date]) Between [Forms]![TeamFilter]![Start Date] And [Forms]![TeamFilter]![End Date]))

    GROUP BY [SPV Names].SPVNameRank

    PIVOT [Performance Window Extended].[Good Show/ Bad Show];

    Thanks for helping

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-10-02T00:11:12+00:00

    Here is the SQL

    Query Parameters dialog box

    PARAMETERS [Forms]![TeamFilter]![Start Date] DateTime, [Forms]![TeamFilter]![End Date] DateTime;

    TRANSFORM Count([Performance Window Extended].[ID ENTRY]) AS [CountOfID ENTRY]

    SELECT [SPV Names].SPVNameRank, Count([Performance Window Extended].[ID ENTRY]) AS [Total Of ID ENTRY]

    FROM [SPV Names] INNER JOIN [Performance Window Extended] ON [SPV Names].ID = [Performance Window Extended].[Reporting SPV]

    WHERE ((([Performance Window Extended].[PW Date]) Between [Forms]![TeamFilter]![Start Date] And [Forms]![TeamFilter]![End Date]))

    GROUP BY [SPV Names].SPVNameRank

    PIVOT [Performance Window Extended].[Good Show/ Bad Show];

    Thanks for helping.

    Was this answer helpful?

    0 comments No comments
  4. ScottGem 68,830 Reputation points Volunteer Moderator
    2015-10-01T11:36:44+00:00

    I suspect the problem is in data entered after that date. But as Duane says we need to see the SQL behind your recordsource. Also, is your report set up for dynamic headings?

    Was this answer helpful?

    0 comments No comments
  5. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2015-10-01T03:59:45+00:00

    Please share the SQL view of the crosstab. Did you declare the data types of the parameters? Did you enter column headings in the Column Headings property?

    Are you using dates as column headings or possibly persons?

    Was this answer helpful?

    0 comments No comments