Results 1 to 10 of 10
  1. #1
    shahidnc is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    11

    Help Required in creating queries in access 2016

    Hi Guys,
    I am working on an assignment and stuck on a query. Assignment is "DECORATIVE CONCRETE DATABASE" from the book "Problem Solving Cases in MS Access & Excel"

    I am stuck at following queries.

    screenshots are attached for the forums I have generated as well as DB file in a ZIP.

    Query 2
    Create a query called Number of Jobs. Specify a type of concrete and count the number of jobs for that type.
    Your query should prompt for the type of concrete so that the owners can run the query for different types.
    Note the column heading change from the default setting provided by the query generator. If you enter “Basic” as the type of concrete.




    Query 3
    Create a query called Most Lucrative Product that specifies each type of concrete and then shows the total square footage and total cost for all jobs that use each type of concrete. (Hint: The Total Cost field is a calculated field with aggregated data.) Note the column heading change from the default setting provided by the query generator. Sort your output to show the most lucrative product first.


    Thanks in Advance
    Attached Thumbnails Attached Thumbnails db.JPG   db1.jpg   db2.JPG  
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    At this link, scroll down to Group By Features to learn how to do these queries.

    http://www.techonthenet.com/access/queries/index.php

    Since this appears to be a homework assignment, I feel that learning by doing is more beneficial than providing you with the correct solution.

  3. #3
    shahidnc is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    11
    Dear alansidman
    Thanks for your reply. This is something I am trying since yesterday. Nothing seems to be working. If you can point me out to right direction I'll be thankful.

  4. #4
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Have you looked at the tutorial I provided you? What does your query look like now. Post your current SQL Statement for analysis.

  5. #5
    shahidnc is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    11
    I just have added a new picture. :/ not working
    Attached Thumbnails Attached Thumbnails db3.JPG  

  6. #6
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I would suggest you try this for the first query:

    SELECT [Jobs Data].Type, Count([Jobs Data].Type) AS CountOfType
    FROM [Jobs Data]
    GROUP BY [Jobs Data].Type
    HAVING ((([Jobs Data].Type)=[What type of Job?]));


    and this for the second query:

    SELECT [Jobs Data].Type, Sum([Jobs Data].[Square Footage]) AS [SumOfSquare Footage], Sum(([Concrete Types&Prices].[Price/Sq ft])*([Jobs Data].[Square Footage])) AS Total
    FROM [Concrete Types&Prices] INNER JOIN [Jobs Data] ON [Concrete Types&Prices].Type = [Jobs Data].Type
    GROUP BY [Jobs Data].Type;


    By giving you this, I am sure it will help with you completing your assignment, but I am unsure if it will benefit you in learning about grouping queries. Read the tutorial again and see if you can understand what I have presented to you.

    As a side note: When naming fields, it is dangerous to use spacing and non text or non numerical characters. I prefer the Camel Syntex when creating fields, ie. FirstName, LastName, etc.

  7. #7
    shahidnc is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    11
    Hi,
    thanks a lot for your suggestions but things aren't working.. I couldn't figure it out that which formula where to put. I tried with so different conbinations but getting errors. screenshot attached.
    I am a business student and I took Database course from higher semester. and it is getting hard to understand as I have very basic knowledge for writing codes.
    Attached Thumbnails Attached Thumbnails db4.JPG  

  8. #8
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    See your database attached with the query properly shown.
    Attached Files Attached Files

  9. #9
    shahidnc is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2016
    Posts
    11
    Thanks a lot. can you give me some links to easy understanding of SQL basics? Thanks

  10. #10
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Look here---->http://www.w3schools.com/sql/default.asp

    Nearly all databases use SQL of some sort. In Access you have a user interface that lets you build your queries in a grid, and simultaneously builds the query in SQL so that the database can run the query.

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

Similar Threads

  1. Summations in Access 2016 Web App queries
    By shinydiamond in forum Queries
    Replies: 1
    Last Post: 05-24-2016, 03:25 PM
  2. Replies: 1
    Last Post: 02-23-2016, 11:14 AM
  3. Replies: 1
    Last Post: 12-07-2015, 10:06 AM
  4. Replies: 1
    Last Post: 05-05-2015, 03:41 PM
  5. Creating Required Fields on a form
    By topp in forum Access
    Replies: 4
    Last Post: 06-27-2012, 03:20 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