Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement Help here

Status
Not open for further replies.
Joined
Jul 16, 2004
Messages
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


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top