Well folks I found out how to do what I wanted. I don't think I explained
it well so here goes again.
Select a, b, iff(b>0,Null,Null) as c from file1
Union Select a,iff(c>0,null,null) as b,c from file1;
what this gives me is the following:
File1:
a b c
1 2 3
2 4 5
3 6
Output:
a b c
1 2
1 3
2 4
2 5
3 6
For every input record I'm getting at least 1 maybe 2 output records
depending on what is in B & C. Hopefully this will help others trying to do
the same thing in the future.
Thanks for your help folks.
Jim
<ji********@compumarc.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
JAMES L REID wrote: Can anyone tell me how to write a query that does the following:
If I understand what you're saying:
tblAccountOptions
Account Number Double (Primary Key?)
Select 1 Double
Select 2 Double
1234.2 Null Null
1234.3 83.1 54.2
1234.4 Null 51.0
should give:
1234.3 83.1
1234.3 54.2
1234.4 51.0
SELECT A.[Account Number], A.[Select 1] AS Selected
FROM tblAccountOptions AS A INNER JOIN tblAccountOptions ON A.[Account
Number] = tblAccountOptions.[Account Number]
WHERE (((A.[Select 1]) Is Not Null)) UNION SELECT A.[Account Number],
A.[Select 2] AS Selected
FROM tblAccountOptions AS A INNER JOIN tblAccountOptions ON A.[Account
Number] = tblAccountOptions.[Account Number]
WHERE (((A.[Select 2]) Is Not Null));
gave me:
Account Number Selected
1234.3 54.2
1234.3 83.1
1234.4 51
Note that the word 'select' by itself is a reserved word. Yes, I tried
using it first. Duh! :-)
James A. Fortune