listing out nos

C

cliff

Hi, I want to list out numbers from 1to 25 in groups of 3 on fullfiling
certain conditions :_

for eg.,
I want to list all possible combinations of 3 numbers from 1 to 20 with
a difference no1. and no.2 should be 5 and difference no.2 and no.3 is 8 .
My output should be something like this :-

1 6 14
2 7 15
3 8 16
4 9 17
5 10 18
6 11 19
7 12 20

please help me out

thanks

cliffs
 
D

Duane Hookom

Assuming a table named [tblNums] with a numeric field [Num], you SQL view of
a query might look like:
SELECT tblNums.Num, tblNums_1.Num, tblNums_2.Num
FROM tblNums, tblNums AS tblNums_1, tblNums AS tblNums_2
WHERE ((([tblNums_1].[Num]-[tblNums].[Num])=5) AND
(([tblNums_2].[Num]-[tblNums_1].[Num])=8));
 
C

cliff

Hi duane Hookom,

Thanks for your help. Actually I want to generate nos in a groups of 3 for
all possible combinations from No.1 to 20 but list out only nos matching
condition stated above : I would like to generate nos like this :

1 2 3
1 2 4
1 2 5
1 2 6
1 2 7
23 24 25



please help me to solve this


thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top