If it weren't for the default, 0-9 case, I'd just say you should normalize the
structure into a 1-m reationship instead of using a comma-delimited field. I
still think something like that would be a good target (any other takers?),
but the only simple answer I can think of required leaving the structure the
way it is.
OK, create another table called tblDigit...
digit
0
1
2
3
4
5
6
7
8
9
Now, here's the query...
SELECT tblTable1.field1 & tblDigit.digit
FROM tblTable1, tblDigit
WHERE tblTable1.field2 IS NULL OR
"," & tblTable1.field2 & "," LIKE "*," & tblDigit.digit & ",*"
Technically, all the comma stuff is not required here, but if the number of
digits per number were variable instead of a single digit, you would need it
to prevent false matches. Also, if you use ADO, use % instead of * for
wildcard characters.
On 15 Jan 2004 09:52:34 -0800,
Sm******@aol.com (Smythe32) wrote:
I have data that looks like the following:
field1 field2
123456 0,2,4,6
234567 1,2,3
345678
(if there are no values in field2, it is implied that they are 0-9)
What I am trying to do is end up with data that looks like the following:
1234560
1234562
1234564
1234566
2345671
2345672
2345673
3456780
3456781
3456782
3456783
3456784
3456785
3456786
3456787
3456788
3456789
Does anyone have any clue about this?
Thanks