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 |
|
irfanshirur
Starting Member
21 Posts |
Posted - 2009-09-03 : 05:48:20
|
| Hi Can any one tell me how we can use the this perticuler secenario in where CLauseBased on if(PPSD.Responsibility_Type_Code =1 ){//then i want this condition to append in where clauseAND ( C.Originial_Submission_Date <='9/3/2009 12:03:57 PM') and ((DATEDIFF(DD, C.Originial_Submission_Date ,'9/3/2009') >= 0 ) and (DATEDIFF(DD, C.Originial_Submission_Date ,'9/3/2009') <=30)) }else this perticuler condition in Where clause{AND ( CSD.Claim_Submission_Date <='9/3/2009 12:03:57 PM') and ((DATEDIFF(DD, CSD.Claim_Submission_Date ,'9/3/2009') >= 0 ) and (DATEDIFF(DD, CSD.Claim_Submission_Date ,'9/3/2009') <=30)) }Please let me know if any one have any idea how we can go ahead with thes kind of scenario.ThanksRegardsMohammed Irfan |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-09-03 : 06:04:30
|
| where((PPSD.Responsibility_Type_Code =1 )and {AND ( C.Originial_Submission_Date <='9/3/2009 12:03:57 PM') and ((DATEDIFF(DD, C.Originial_Submission_Date ,'9/3/2009') >= 0 ) and (DATEDIFF(DD, C.Originial_Submission_Date ,'9/3/2009') <=30)) }or{( CSD.Claim_Submission_Date <='9/3/2009 12:03:57 PM') and ((DATEDIFF(DD, CSD.Claim_Submission_Date ,'9/3/2009') >= 0 ) and (DATEDIFF(DD, CSD.Claim_Submission_Date ,'9/3/2009') <=30)) )MadhivananFailing to plan is Planning to fail |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-03 : 06:05:39
|
Try thiswhere (PPSD.Responsibility_Type_Code =1 AND( C.Originial_Submission_Date <='9/3/2009 12:03:57 PM') and ((DATEDIFF(DD, C.Originial_Submission_Date ,'9/3/2009') >= 0 ) and (DATEDIFF(DD, C.Originial_Submission_Date ,'9/3/2009') <=30)) )OR( CSD.Claim_Submission_Date <='9/3/2009 12:03:57 PM') and ((DATEDIFF(DD, CSD.Claim_Submission_Date ,'9/3/2009') >= 0 ) and (DATEDIFF(DD, CSD.Claim_Submission_Date ,'9/3/2009') <=30)) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-03 : 06:06:10
|
 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|