Sabtu, 12 Maret 2016

Re: [MS_AccessPros] INSPECTION

 

Ade-


So, you want all the combinations of the items taken 6 at a time?

SELECT One.SNo, One.Item, Two.SNo, Two.Item, Three.SNo, Three.Item, Four.SNo, Four.Item, Five.SNo, Five.Item, Six.SNo, Six.Item
FROM MyTable As One, MyTable As Two, MyTable As Three, MyTable As Four, MyTable As Five, MyTable As Six
WHERE Two.SNo > One.SNo AND Three.SNo > Two.SNo AND Four.SNo > Three.SNo, AND Five.SNo > Four.SNo AND Six.SNo > Five.SNo;

I come up with 3003 rows.

    14!                  14!             14x13x12x11x10x9
—————  =  —————— = ———————————  = 3003
6!(14-6)!             6!8!                6x5x4x3x2

Now if you want to randomly pick 5 items to be "defective" and then see how many rows have all five of them, that gets a bit tricky.  Because of the way I constructed the query, Tea can only ever show up in the last column.  Inkjetink can show up in columns five or six.  Calculators can show up in columns four, five, and six, and so on.  Conversely, Doritos can only show up in column one. Fizzydrink can show up in one or two, and so on.  You would need to construct a WHERE clause that looks for the five items, but if Notepads, for example, is one the items, you have to check all six columns, BUT you only have to check the first column if the other four deficits are items 7 or higher.  An exercise left for the reader.  😃


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Mar 12, 2016, at 5:18 PM, Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Thanks John. Lets assume I want to choose from 14 cartons containing commonly used office items as shown below.

S/No Item in carton
1 Doritos
2 Fizzydrink
3 Applejuice
4 Copyingpaper
5 Lasejetink
6 Notepads
7 Writing pens
8 Shredder
9 USB
10 Batteries
11 Mousepads
12 Calculators
13 Inkjetink
14 Tea




From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Saturday, 12 March 2016, 15:50
Subject: Re: [MS_AccessPros] INSPECTION

 
Ade-

Do you already have this data in tables, or are you trying to decide whether to put the data in Access to solve your problem?  I can state unequivocally that your problem should be solvable with queries in Access, but I can't give you a specific solution until you've laid it out in tables.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Mar 12, 2016, at 4:27 PM, Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Defects can only be proven on inspection. What I am trying to create from the scenario is a theoretical construct of the mathematical possibilities given the criteria set using Access.

Assume for ease that the 14 items are all of different types.

Thanks.

Ade.





From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Saturday, 12 March 2016, 15:17
Subject: Re: [MS_AccessPros] INSPECTION

 
Ade-

Is that the layout of your table?  That's not normalized.  What is the actual structure of your tables?  What tells you that one or more are defective?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Mar 12, 2016, at 3:08 PM, Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

For each lot or record , you will have

Item1 Item2 Item3 Item 4 Item5 Item6

The challenge is that the items that are defective are not known in advance.

Thanks.

Ade.







From: "John Viescas JohnV@msn.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com
Sent: Saturday, 12 March 2016, 14:01
Subject: Re: [MS_AccessPros] INSPECTION

 
Ade-

Probably, but we would need to know the layout of your relevant tables.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Mar 12, 2016, at 2:15 PM, Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hi all,

i am looking for help with a code for combinations for an inspection problem which can be generalized to similar problems.

Suppose there are 14 items to checked for defects in lots of 6 each. The idea is to be able to  catch a lot with 5 defectives if that lot contains 5 defectives. I know combination wise, this should give 579 combinations.

Is there any way this can be handled in MSAccess ?

Thanks.

Ade.














__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

Save time and get your email on the go with the Yahoo Mail App
Get the beautifully designed, lighting fast, and easy-to-use, Yahoo Mail app today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Poskan Komentar