look-back through historical MDB for digits without regard to orde

V

voxorganum

hi. i'd like to know how to do a "find" for records in a single column with a
number combination,
example: "123" which could be in any order.

so i'd be finding any record in a column containing: 123, 132, 213, 231,
312, or 321 without having to enter each different combination.

i'll try to explain as best i can.

first, this is about "Cash 3" of the Florida lottery: www.flalottery.com

i'm just trying to find draw-history patterns of the 3-number combinations
which can have same digits and can be any combination/order, 0-9.

so i was hoping to do "look-backs" in the history of the drawings to find
3-number combination frequencies without regard to their order as they're
drawn.

so i need to be able to "look-back" through the draw dates and find
occurences of 3-number combinations.

for example: recently, 479 was drawn. i want to look back and see when the
last time it was that 479 was drawn WITHOUT regard to the order that 479 was
drawn the last time it was drawn. it could be 974 or 497 or whichever.

i wish there was some way i could just click on the binoculars on the menu
above my table/draw-history, and make some instruction for the "FIND" along
with "479" and have Access return the last date or all the dates that 479 was
drawn WITHOUT regard to the order those three numbers were drawn.

i hope this makes things easier to understand. THANKS for any help!! (^_^)
 
D

Douglas J. Steele

I believe you've already posted this question, and were already told that it
can't be done using the binoculars. I also believe you were told that you
shouldn't store multiple numbers in a single column: that each number should
be a separate column.

If you're insistent about keeping the numbers in a single column, though,
you could write a function that accepts the number from the table and the
target number and returns True or False.

Something along the lines of the following untested air-code should do it:

Function CompareNumbers(NumberIn As String, TargetNumber As String) As
Boolean

Dim booFound As Boolean
Dim intPos1 As Integer
Dim intPos2 As Integer
Dim strCurrIn As String
Dim strCurrTarget As String

booFound = True

For intPos1 = 1 To Len(TargetNumber)
' Pick a specific digit to search for
strCurrTarget = Mid$(TargetNumber, intPos1, 1)
For intPos2 = 1 To Len(NumberIn)
strCurrIn = Mid$(NumberIn, intPos2, 1)
If strCurrTarget = strCurrIn Then
' If the digit's found, get out of the inner loop
Exit For
End If
' If you get to this point, the digit doesn't exist in the NumberIn
booFound = False
Next intPos2
' No point continuing if you've already got an unfound digit
If booFound = False
Exit For
End If
Next intPos1

CompareNumbers = booFound

End Function
 
V

voxorganum

no, i have the digits in separate columns as well as grouped together in a
single column. i did this knowing i would want to know things like frequency
of single numbers in draw position a, b or c, etc.

please reply and let me know how to pursue what i'm trying to accomplish
with this new information.

THANKS for any help!! (^_^)
 
V

voxorganum

no, i have the digits in separate columns as well as grouped together in a
single column. i did this knowing i would want to know things like frequency
of single numbers in draw position a, b or c, etc.

as to your skepticism, it is just as UN-likely that a draw history would be
perfectly random in numbers or combinations as it would be UN-likely that
there would be a greater tendency towards certain numbers or combinations.
HOWEVER, a look at those frequencies reveals that, indeed, there are
tendencies towards certain numbers and combinations, BIG ONES.

please reply and let me know how to pursue what i'm trying to accomplish
with this new information.

THANKS for any help!! (^_^)
 
V

voxorganum

I don't think you understand what i'm seeing with my own eyes in these
tables, and you also don't know how much i've won (don't bother asking). AND
besides your opinions aren't helping me with what i came here looking for
which is help with a specific question regarding ACCESS and how to accomplish
a certain task therein.

thanks anyway. (^_^)
 
Top