CR 9.0/Sybase ASA 6.0.2
Table Activity LOJ to table Program.ProgDesc (to determine program name that may or may not have been selected for Activity)
Table Activity also LOJ to table PatReg.ProgNo (through 2 other tables) (to determine program name patient belongs to if activity included patient)
I need to pull all activities relating to Acquired Brain Injury. I can tell that because:
the Program.ProgDesc = 'Acquired Brain Injury'
or
the PatReg.ProgNo = 83
For some activities both fields will be entered
For some only one or the other of progdesc or progno will be entered
Example
Activity No ProgDesc ProgNo
1 Acquired Brain Injury 83
2 Acquired Brain Injury
3 83
4 Developmental Clinic 111
5 Developmental Clinic
6 111
The report needs to return activity no 1,2 and 3
{Activity.ActivityDateTime} = {?Activity Date/Time Range} and
({Prog.ProgDesc}= "Acquired Brain Injury" OR {PatReg.ProgNo}= 83)
//does NOT return activity 3
//returns activity 1 and 2
{Activity.ActivityDateTime} = {?Activity Date/Time Range} and
({PatReg.ProgNo}= 83 OR {Prog.ProgDesc}= "Acquired Brain Injury" )
//does NOT return activity 2
//returns activity 1 and 3
I've been trying all sorts of combos of the above but no go. Any help much appreciated. Please let me know if I haven't provided enough info....
Table Activity LOJ to table Program.ProgDesc (to determine program name that may or may not have been selected for Activity)
Table Activity also LOJ to table PatReg.ProgNo (through 2 other tables) (to determine program name patient belongs to if activity included patient)
I need to pull all activities relating to Acquired Brain Injury. I can tell that because:
the Program.ProgDesc = 'Acquired Brain Injury'
or
the PatReg.ProgNo = 83
For some activities both fields will be entered
For some only one or the other of progdesc or progno will be entered
Example
Activity No ProgDesc ProgNo
1 Acquired Brain Injury 83
2 Acquired Brain Injury
3 83
4 Developmental Clinic 111
5 Developmental Clinic
6 111
The report needs to return activity no 1,2 and 3
{Activity.ActivityDateTime} = {?Activity Date/Time Range} and
({Prog.ProgDesc}= "Acquired Brain Injury" OR {PatReg.ProgNo}= 83)
//does NOT return activity 3
//returns activity 1 and 2
{Activity.ActivityDateTime} = {?Activity Date/Time Range} and
({PatReg.ProgNo}= 83 OR {Prog.ProgDesc}= "Acquired Brain Injury" )
//does NOT return activity 2
//returns activity 1 and 3
I've been trying all sorts of combos of the above but no go. Any help much appreciated. Please let me know if I haven't provided enough info....