Results 1 to 8 of 8
  1. #1
    sandeebee123 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7

    Please help Access Query Unable to open in design view only showing SQL need Help!!!

    I am trying to run an Access query that someone completed in SQL. Below is the query:

    SELECT Employees.Supervisor, [Work Hours].[Full Name], [Work Hours].[Date Worked], [Work Codes].[Productivity Type], [Work Codes].WorkCode, Sum([Work Hours].Hours) AS Hours, [Work Hours].Description, [Work Hours].ManualCount, [Employees-Active].WindowsID AS SupWinID
    FROM (Employees INNER JOIN ([Work Hours] LEFT JOIN [Work Codes] ON [Work Hours].[Work Code]=[Work Codes].ID) ON Employees.[Full Name]=[Work Hours].[Full Name]) INNER JOIN [Employees-Active] ON Employees.Supervisor=[Employees-Active].[Employee Name]
    WHERE (((Employees.EmpType)="RS"))
    GROUP BY Employees.Supervisor, [Work Hours].[Full Name], [Work Hours].[Date Worked], [Work Codes].[Productivity Type], [Work Codes].WorkCode, [Work Hours].Description, [Work Hours].ManualCount, [Employees-Active].WindowsID


    HAVING ((([Work Hours].[Date Worked]) Between (Date()-Weekday(Date()))-6 And Date()-Weekday(Date())))
    ORDER BY Employees.Supervisor, [Work Hours].[Full Name], [Work Hours].[Date Worked];

    I am getting the following error:
    Compile error. in query expression '((([Work.Hours].[Date Worked]) Between (date()-Weekday(Date()))-6 And Date ()-Weekday(Date()))'.

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Make sure all of the tables and fields are still named the same and have the appropriate properties. I would start with [Work Hours].[Date Worked].

  3. #3
    sandeebee123 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    I don't know SQL enough to do that.

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    In SQL, the brackets hold the names of the tables and fields - [TableName].[FieldName]. Based on that information in the SQL, look at the TABLES in your database to make sure all of the FIELDS are still present. It sounds like a Field or Table has been deleted.

  5. #5
    sandeebee123 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    So where do I put that? in the beginning?

    SELECT * FROM Users WHERE Clue > 0

  6. #6
    sandeebee123 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    7
    So what do I do? I can only view it in SQL.

  7. #7
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    You should be able to look through the database to find the tables.

    Can you post the database for analysis?

  8. #8
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    You can copy the SQL to a Note Pad file, close the query, then look through the database deleting each Table.Field combination you come across as you walk through the SQL.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Unable to view query in design view
    By vemi007 in forum Queries
    Replies: 7
    Last Post: 01-19-2012, 11:36 AM
  2. Can't open database in design view.
    By mike96 in forum Access
    Replies: 13
    Last Post: 11-18-2011, 04:06 PM
  3. Form will not open View or Design
    By aldeb47 in forum Forms
    Replies: 2
    Last Post: 06-15-2011, 07:03 AM
  4. Design view not showing data (Pivot Chart)
    By thestappa in forum Reports
    Replies: 0
    Last Post: 06-24-2010, 09:59 AM
  5. Query Design View Takes a Long Time to Open
    By jackthedog in forum Queries
    Replies: 0
    Last Post: 12-22-2009, 03:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums