Results 1 to 7 of 7
  1. #1
    yeleek is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    6

    Lookup a field from another table?

    Hi,



    I have a query which is collecting the number of alerts per weeknumber for a given month, i'm then using this in a report to display the results.

    So the report may show

    Week 19 20 alerts

    I've another table which has 3 columns, weeknumber, year and weekstart. This is fully populated (via excel) with weeknumber, year and weekstart until 2015.

    The idea being for the original report I would like it to be able to say week 19, 20 alerts, and then retrieve the weekstart from the 2nd table (it knows the year as that is part of the criteria). Is this possible and if so how please?

    Thank you in advance

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    On what table(s) is the query based? What are the fields in the query? You may be able to create a query that joins your first query with the table you mention and then you would have access to all fields in both including the weekstart.

  3. #3
    yeleek is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    6
    Click image for larger version. 

Name:	query.JPG 
Views:	13 
Size:	31.2 KB 
ID:	8006
    Hi the query looks like above, and as I say I've another table which has 3 fields, week number, year and weekcommencing. What I'd like is that for each week number in a month (as per criteria) it pulls the weekcommencing from the other table. Is that possible? Thanks

  4. #4
    yeleek is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    6
    Alternatively is there a calculated query field i can create which given the [Week] and [year] can work out the date of the monday?

    Thanks in advance

  5. #5
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You should be able to create a query that includes the query you mention and the table. You would join the two via the week and displayyear in the query to their respective fields ([week number] and [year]) of the table.

  6. #6
    yeleek is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    6
    Week is a calculated field in this query, can you join that to a field on another table via a relationship?

    I ask as I've tried via relationship, and then running the query and access just sits there. Saying its running the query.

  7. #7
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Yes, you should be able to do that.

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

Similar Threads

  1. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  2. Replies: 1
    Last Post: 02-29-2012, 10:13 PM
  3. Query to lookup relative field from table selection
    By shabbaranks in forum Queries
    Replies: 5
    Last Post: 12-20-2011, 11:12 AM
  4. table lookup / null field values, help!
    By benjammin in forum Forms
    Replies: 3
    Last Post: 07-27-2011, 01:56 PM
  5. Use a lookup field to influence values in another field
    By nathanrt in forum Database Design
    Replies: 3
    Last Post: 01-13-2011, 03:40 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