Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How get true or false status

Author  Topic 

esambath
Yak Posting Veteran

89 Posts

Posted - 2009-04-13 : 02:47:59
Hi,
I am using two tables.
1.Newsletter
2. UserNewsLetter.

Newsletter table UserNewsLetter table
NewsID NewsletterName UserId NewsletterID

1 Newsletter1 1 1
2 Newsletter2 1 2
3 Newsletter3 2 1
4 Newsletter4 1 3

I need following output for userID 1

NewsID Status

1 True

2 True

3 True

4 False

I am need to get NewsID and Status for each user























dsindo
Starting Member

45 Posts

Posted - 2009-04-14 : 20:12:17
you mean?

NewsID Status

1 True

2 True

3 False

4 True

you have sample data on UserNewsLetter table
Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2009-04-15 : 22:08:33
why is 3 true to userid 1, is this what u mean

USERID NewsID Status

1 1 True

1 2 True

1 3 FALSE

1 4 True

Use CASE STATEMENTS




-----------------------------------------------------------------------------------------------
Ashley Rhodes
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-04-15 : 23:53:20
Hi ,

Can u Explain Clearly what u want ?
Go to Top of Page
   

- Advertisement -