Private Sub all104_Click()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("all35")'表名all35
Dim t1, t2, t3, t4, t5, t6, t7
t1 = 1
t2 = 2
t3 = 9
t4 = 11
t5 = 23
t6 = 24
t7 = 31
With rst
Do While t1 <= 12’第一个号码的取值范围
Do While t2 <= 16
If t1 >= t2 Then t2 = t1 + 1
Do While t3 <= 20
If t2 >= t3 Then t3 = t2 + 1
Do While t4 <= 29
If t3 >= t4 Then t4 = t3 + 1
Do While t5 <= 32
If t4 >= t5 Then t5 = t4 + 1
Do While t6 <= 34
If t5 >= t6 Then t6 = t5 + 1
Do While t7 <= 35
If t6 >= t7 Then t7 = t6 + 1
.AddNew
!n1 = t1'n1~n7为字段名
!n2 = t2
!n3 = t3
!n4 = t4
!n5 = t5
!n6 = t6
!n7 = t7
.Update
End Sub 作者: cattjiu 时间: 2003-1-3 20:25
大家关心一下彩票把:
1. 删除7个区域中4个区域没有号码的记录:
DELETE all35.n2, all35.n3, all35.n4, all35.n5
FROM all35
WHERE (((all35.n2)<=5) AND ((all35.n3)>=16) AND ((all35.n4)<=20) AND ((all35.n5)>=26));
2. 删除总和小于70或者大于180:
DELETE ALL35.n1, ALL35.n2, ALL35.n3, ALL35.n4, ALL35.n5, ALL35.n6, ALL35.n7, [n1]+[n2]+[n3]+[n4]+[n5]+[n6]+[n7] AS tt
FROM ALL35
WHERE ((([n1]+[n2]+[n3]+[n4]+[n5]+[n6]+[n7])>=158));
3.删除递增数多于2:
DELETE ALL35.n1, ALL35.n2, ALL35.n3, ALL35.n4, ALL35.n5, ALL35.n6, ALL35.n7, IIf(Val([n2])-Val([n1])=Val([n3])-Val([n2]),1,0)+IIf(Val([n3])-Val([n2])=Val([n4])-Val([n3]),1,0)+IIf(Val([n4])-Val([n3])=Val([n5])-Val([n4]),1,0)+IIf(Val([n5])-Val([n4])=Val([n6])-Val([n5]),1,0)+IIf(Val([n6])-Val([n5])=Val([n7])-Val([n6]),1,0) AS tt
FROM ALL35
WHERE (((IIf(Val([n2])-Val([n1])=Val([n3])-Val([n2]),1,0)+IIf(Val([n3])-Val([n2])=Val([n4])-Val([n3]),1,0)+IIf(Val([n4])-Val([n3])=Val([n5])-Val([n4]),1,0)+IIf(Val([n5])-Val([n4])=Val([n6])-Val([n5]),1,0)+IIf(Val([n6])-Val([n5])=Val([n7])-Val([n6]),1,0))>2));
4. 删除偶数为1个或者7个:
DELETE ALL35.n1, ALL35.n2, ALL35.n3, ALL35.n4, ALL35.n5, ALL35.n6, ALL35.n7, Abs(Int(Val([n1])/2)*2-Val([n1]))+Abs(Int(Val([n2])/2)*2-Val([n2]))+Abs(Int(Val([n3])/2)*2-Val([n3]))+Abs(Int(Val([n4])/2)*2-Val([n4]))+Abs(Int(Val([n5])/2)*2-Val([n5]))+Abs(Int(Val([n6])/2)*2-Val([n6]))+Abs(Int(Val([n7])/2)*2-Val([n7])) AS t1
FROM ALL35
WHERE (((Abs(Int(Val([n1])/2)*2-Val([n1]))+Abs(Int(Val([n2])/2)*2-Val([n2]))+Abs(Int(Val([n3])/2)*2-Val([n3]))+Abs(Int(Val([n4])/2)*2-Val([n4]))+Abs(Int(Val([n5])/2)*2-Val([n5]))+Abs(Int(Val([n6])/2)*2-Val([n6]))+Abs(Int(Val([n7])/2)*2-Val([n7])))=1 Or (Abs(Int(Val([n1])/2)*2-Val([n1]))+Abs(Int(Val([n2])/2)*2-Val([n2]))+Abs(Int(Val([n3])/2)*2-Val([n3]))+Abs(Int(Val([n4])/2)*2-Val([n4]))+Abs(Int(Val([n5])/2)*2-Val([n5]))+Abs(Int(Val([n6])/2)*2-Val([n6]))+Abs(Int(Val([n7])/2)*2-Val([n7])))=7));
5.1 尾数统计查询:
SELECT all35.n1, all35.n2, all35.n3, all35.n4, all35.n5, all35.n6, all35.n7, Right(Str([n1]),1) AS t1, Right(Str([n2]),1) AS t2, Right(Str([n3]),1) AS t3, Right(Str([n4]),1) AS t4, Right(Str([n5]),1) AS t5, Right(Str([n6]),1) AS t6, Right(Str([n7]),1) AS t7
FROM all35;
5.2 删除尾数相同: 作者: 730423 时间: 2003-1-5 05:30
感谢斑竹,中奖后会报答的!!!