Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Posts
    4

    Exclamation Help with Query

    SELECT tblUser.Dept, TblUsedHour.UID, TblUsedHour.EmpID, TblUsedHour.PositionNum, TblUsedHour.UsedHour, TblUsedHour.UsedDate
    FROM tblUser INNER JOIN TblUsedHour ON tblUser.EmpID = TblUsedHour.EmpID
    WHERE (((TblUsedHour.UsedDate) Is Not Null And (TblUsedHour.UsedDate) Between [Forms]![Report Date Range]![BeginDate] And [Forms]![Report Date Range]![EndDate]))
    ORDER BY tblUser.Dept, TblUsedHour.EmpID;


    The above is a query called QryHourUsed (it works)

    SELECT QryUsedHour.Dept, QryUsedHour.EmpID, Sum(QryUsedHour.UsedHour) AS SumOfUsedHour
    FROM QryUsedHour


    GROUP BY QryUsedHour.Dept, QryUsedHour.EmpID
    ORDER BY QryUsedHour.Dept, QryUsedHour.EmpID;

    The above is called QryTotalUsedHour

    This query fails to execute unless I remove Sum(QryUsedHour.UsedHour) AS SumOfUsedHour

    Can anyone please help me with this?

  2. #2
    Join Date
    Apr 2009
    Posts
    4
    can anyone help?

  3. #3
    CraigDolphin is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Apr 2009
    Location
    Custer, WA, USA
    Posts
    125
    Can you post a zipped copy of your database? If so I'll take a look.

  4. #4
    Join Date
    Apr 2009
    Posts
    4
    I'll see if I can provide the DB without the data. Whats your email address?

  5. #5
    CraigDolphin is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Apr 2009
    Location
    Custer, WA, USA
    Posts
    125
    My workplace filters any attachments with mdb or zip suffixes so email is not really a good option. You can attach the zipped db to a post here by clicking the Go Advanced button, then scroll down and click the manage attachments button to upload the file. If possible, remove any sensitive data, but have enough data (fake or otherwise) to test that the query is working as expected.

  6. #6
    Join Date
    Apr 2009
    Posts
    4
    I would email you a link (on my server) to the site that has the file if you cant receive attachments.

    I'd rather not post the entire file on this forum(s)

  7. #7
    CraigDolphin is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Apr 2009
    Location
    Custer, WA, USA
    Posts
    125
    Hi,

    if the concern is data confidentiality you can make a copy of your db, and delete all the data, and forms etc that that are not pertinent to this question. Mainly I want to look at the table structure and the queries themselves.

    That said, it would be nice to have a few records of data to be sure the queries are working the way you expect.

    And the same IT dept that filters email also blocks file sharing sites....

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

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