melbert2002
MIS
- Jul 16, 2004
- 153
I have a DTS package to create but I am quite the novice on SQL statements. So here is the logic on what I need to do.
The DTS needs to pull only A,B,C,D from one field
when this is first sorted out
then
Only When the field “intyn” = Y
Then display of the origianl pull
Then If the field “addyn” = Y then only include a certain subset of the pulled data and leave the rest blank.
If the field “intyn” = n or anything else then include everything from the original querry.
I have some simple questions on this first. How do I sort out the first part of this querry. I thinking it should be something like:
select "certain fields" from TABLE
Where (Field = 'A','B','C','D')
IF INTYN = Y
Then Display all
IF INTYN = N
Then Display nothing
IF ADDYN = N
THEN DISPLAY ALL
IF ADDYN = Y
THEN DISPLAY (field subset and leave everthing else blank)
That is the basic logic behind it. I need to pull this DTS on a daily basis. Creating the DTS and scheduling it I am fine with, but it has been a about a year since I have really done anything with SQL statements in school.
Thanks in advance
Mel
The DTS needs to pull only A,B,C,D from one field
when this is first sorted out
then
Only When the field “intyn” = Y
Then display of the origianl pull
Then If the field “addyn” = Y then only include a certain subset of the pulled data and leave the rest blank.
If the field “intyn” = n or anything else then include everything from the original querry.
I have some simple questions on this first. How do I sort out the first part of this querry. I thinking it should be something like:
select "certain fields" from TABLE
Where (Field = 'A','B','C','D')
IF INTYN = Y
Then Display all
IF INTYN = N
Then Display nothing
IF ADDYN = N
THEN DISPLAY ALL
IF ADDYN = Y
THEN DISPLAY (field subset and leave everthing else blank)
That is the basic logic behind it. I need to pull this DTS on a daily basis. Creating the DTS and scheduling it I am fine with, but it has been a about a year since I have really done anything with SQL statements in school.
Thanks in advance
Mel