Hi there
I'll try and be as clear as I can, please bear with me
I need to perform a select query from a table which will form the data source for a Crystal Report(either SP or view):
Select client number, data field where if client number = 'x' and data_field > 0 then also retrieve the data_field for account 'y' and 'z' if 'y' and 'z' data_field > 0
ie.
if x|client1|data_field > 0
then only return
x|client1|data_field=12
y|client1|data_field=01
z|client1|data_field=03
Not
y|client1|data_field
z|client1|data_field
(ie if account 'x' does not mean the condition then do not retrieve rows for y and z
I have tried doing subqueries and union queries but either the query returns no data or it returns 'y' and 'z' balances regardless of the data in 'x'
I'm not after a finished query solution, just some pointers/clues towards forcing these conditions together.
Thanks in advance!
Chris
I'll try and be as clear as I can, please bear with me
I need to perform a select query from a table which will form the data source for a Crystal Report(either SP or view):
Select client number, data field where if client number = 'x' and data_field > 0 then also retrieve the data_field for account 'y' and 'z' if 'y' and 'z' data_field > 0
ie.
if x|client1|data_field > 0
then only return
x|client1|data_field=12
y|client1|data_field=01
z|client1|data_field=03
Not
y|client1|data_field
z|client1|data_field
(ie if account 'x' does not mean the condition then do not retrieve rows for y and z
I have tried doing subqueries and union queries but either the query returns no data or it returns 'y' and 'z' balances regardless of the data in 'x'
I'm not after a finished query solution, just some pointers/clues towards forcing these conditions together.
Thanks in advance!
Chris