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.
Author |
Topic |
dzabor
Posting Yak Master
138 Posts |
Posted - 2010-02-10 : 22:21:56
|
I am creating a view in sql. In this view I want to pull data select id from table1 t1where t1.paid_thru >= '04/30/2010'and t1.Join_date <= '12/31/2009'and t1.asofdate = '01/31/2010'and t1.old_chapter = 'CH'I would like take this select statement and any data that falls into thee criteria to return a value into as field such as 'Active'I have been searching around to figure out where to start with this, but can find nothing. Help...dz |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-10 : 22:24:38
|
quote: I would like take this select statement and any data that falls into thee criteria to return a value into as field such as 'Active'
what exactly do you mean by this ?Can you post some sample data and the expected result ? KH[spoiler]Time is always against us[/spoiler] |
|
|
dzabor
Posting Yak Master
138 Posts |
Posted - 2010-02-10 : 22:47:39
|
Table = MembershipID Member Type Join Date Status101 K 01/01/2009 Renewal102 M 03/30/2009 Renewal103 H 01/03/2010 NewI would like to use the Member Type and Join Date If member Type = H and Join Date > 01/01/2010 then populate the Status filed with 'New'. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-02-10 : 22:52:59
|
[code]update mset Status = 'New'from Membership mwhere [Member Type] = 'H' and [Join Date] > '20100101' [/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
dzabor
Posting Yak Master
138 Posts |
Posted - 2010-02-10 : 23:06:39
|
I guess I was over thinking that one!Thanks! |
|
|
|
|
|