Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12

    Exclamation Query into query

    Hi everybody,

    i need a query in a query for a necessary report in microsoft access. Here is the description:

    The first table is named 'Tasks'. It has 5 fields: 'Task ID; Task Name; Due Date; Member; & Description'.
    The second table is named 'Daily Report' and has 8 fields: 'Report ID; Date; Member; Task 1; Task 2; Task 3; Task 4; Task 5'.
    Now i want a query with this fields from these tables: 'Report ID; Date; Member; Task ID; Task Name; Due Date; Description'. But i cannot create it. Please help me ASAP.

    Tnx,


    MRA

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    why 2 queries? Can 1 work?
    use the query designer, bring in the tables you asked.
    join tables on like fields.
    run query.

  3. #3
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    Actually i need 1 query, but i need 2 tables. one has tasks details and the second details of reports which have 5 task IDs related to 'Tasks' table. did you understand?

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Are the tables joined? And why can't you? Too many records? Query won't select data?


    Sent from my iPhone using Tapatalk

  5. #5
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    yes task id numbers are FKs. but the select query or simple query doesn't work or maybe i don't know how to use.

  6. #6
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Have you used query wizard


    Sent from my iPhone using Tapatalk

  7. #7
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    yes but it doesn't work.

  8. #8
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Could you give us the tables with some data?


    Sent from my iPhone using Tapatalk

  9. #9
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    first table:
    Click image for larger version. 

Name:	1.PNG 
Views:	8 
Size:	35.5 KB 
ID:	26864

    reports table:
    Click image for larger version. 

Name:	2.PNG 
Views:	8 
Size:	24.4 KB 
ID:	26865

    the query which i need:
    Click image for larger version. 

Name:	3.PNG 
Views:	8 
Size:	28.3 KB 
ID:	26866

  10. #10
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    and this is the relationships:
    Click image for larger version. 

Name:	4.PNG 
Views:	8 
Size:	21.0 KB 
ID:	26867

  11. #11
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    go into design query SQL mode

    this works for me

    Code:
    SELECT tasks.description, tasks.member, tasks.[due date], tasks.[task name], tasks.[task id], reports.date, reports.[report id]
    FROM reports, tasks;
    I missed your post on joins and didn't have any

  12. #12
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    sorry:
    Click image for larger version. 

Name:	6.PNG 
Views:	7 
Size:	15.2 KB 
ID:	26868

  13. #13
    Mra3134 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    and it wants many parameters from me like tasks.duedate

  14. #14
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Try it now


    Sent from my iPhone using Tapatalk

  15. #15
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    But some of your fields are badly named. (Spaces are never a good idea task_ID) and date shouldn't be used as its a function leading to confusion later.

    I suggest once you have a working query you change the field names and adjust the query accordingly.

    It will save masses of grief later on.


    Sent from my iPhone using Tapatalk

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-15-2016, 02:35 PM
  2. Replies: 2
    Last Post: 04-07-2015, 04:54 PM
  3. Best Practise Query a Query or Query a Table
    By Derrick T. Davidson in forum Access
    Replies: 4
    Last Post: 07-29-2014, 10:18 AM
  4. Replies: 7
    Last Post: 07-11-2013, 10:45 AM
  5. Replies: 7
    Last Post: 05-02-2012, 08:04 AM

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