Forum Discussion
gziegelmeyer
May 27, 2021Copper Contributor
Microsoft Access Question
Hi, I am new to MS Access but have used other MS products for decades. I am trying to figure out a solution to this problem. I have 5 categories (with 1 to many locations associated to a category)...
chrisgrahamdack
May 29, 2021Copper Contributor
Hi Gary, hope all is well.
I am trying to replicate the database structure you've mentioned but would appreciate some more clarity, is this correct?...
2 tables, one containing "Category" as primary key and another "Location" field.
One containing "BlackOutDate" as primary key and another "Category" field.
You've linked "Category" fields together with a one-to-many relationship.
I don't believe this is your setup but would love to know more so I can replicate and help 🙂
Chris
I am trying to replicate the database structure you've mentioned but would appreciate some more clarity, is this correct?...
2 tables, one containing "Category" as primary key and another "Location" field.
One containing "BlackOutDate" as primary key and another "Category" field.
You've linked "Category" fields together with a one-to-many relationship.
I don't believe this is your setup but would love to know more so I can replicate and help 🙂
Chris
- gziegelmeyerMay 29, 2021Copper Contributor
Thanks for taking a look at this!!
I added a screen shot of the tables. There can be 6 categories with multiple rows per category. There can also be multiple blackout dates per category. I want to be able to do a query on a given date and give me back all rows (for a category(s)) that are Not blacked out on that date. When I did a query and put Not (specified date), it returns the row that has multiple black out dates, but with a different blackout date than specified. Example if category 1 has a blackout date of 6/1/21 and 12/13/21, it will still return the row with the 12/13/21 blackout date.
I am not sure these tables are set up the most efficient way either. Let me know if this helps.
- chrisgrahamdackMay 30, 2021Copper ContributorBy "Category" I assume you mean "GEO Code" in this instance?
- gziegelmeyerMay 30, 2021Copper ContributorYes Category = Geo Code. And yes it may not have been set up properly 🙂 I have worked almost any job you can think of in IT, but never a DBA.
- chrisgrahamdackMay 30, 2021Copper ContributorThanks for the PNG, really helpful. It doesn't appear to me that the one-to-many relationship has been formed as intended upon initial glance. However, I will replicate it with less fields in the "Store Master" table and see if I can help with a solution 🙂
I will be back in touch ASAP.