Finding records with dates older than 6 months in a related table

starz25

New Member
Joined
Jan 25, 2009
Messages
2
Hello,

I am new to Access and am having difficulty with the last query I need to design in my database.

I have 2 tables [Family] with fields ID, fName, lName, Lic_Num and Archive (yes/no). [Food_Date] with fields ID, Family and Food_Date. There is a one to many relationship between Family.ID (one) and Food_Date.Family(many).

I would like to know the best way to determine families who have dates older than 6 months in the Food_Date.Food_Date field.

Thanks!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Join your tables in the query on your PK and FK. In the criteria for the Food_Date Field put >Date() + 180. That should give you only records that are older than 180 days from the current date.
 
Upvote 0
alansidman,

Thanks for the quick reply. It looks like that will give me all the records from the Food_Date table that are older than 6 months. Let me clarify what I am trying to find.

I want to create a form where it lists all the Families from the Family table that have either no records in the Food_Date table or have records that are only 6 months old. I plan to use this to archive those families that are not active (families with dates newer than 6 months ago should be excluded).
 
Upvote 0
ok. Got it. In the criteria for the same field add this to the next line down in the criteria which will create an "Or" statement. Is Null. So this will give you everyone that has a record older than 6 months or has no record.

Alan
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top