• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

sql query with criteria

Hi,

Cheers
0
RIAS
Asked:
RIAS
  • 3
1 Solution
 
James MurrellProduct SpecialistCommented:
http://www.sql-tutorial.net/ may help but as you didn't post a question it would be impossible to provide answer
0
 
RIASAuthor Commented:
Sorry the query is :
How do I write a sql query for--
Select *  From Personal_Details  Where  Status at Input_Date  = Activeor Preserved Pensioner or Pensioner or  Widow  or Child
OR where  Status at Input_Date  = No Liability
and  Dateleft,Dbdate, Pdpencomm or Topaid later than Input_Date less 1 Year

Cheers
0
 
RIASAuthor Commented:
I tried attaching the query in code but it didnt get updated.Sorry about that.
0
 
twolCommented:
Select *  From Personal_Details  
Where  
(([Status at Input_Date]  in ('Active','PreservedPensioner','Pensioner','Widow','Child'))
OR ([Status at Input_Date]  = 'No Liability')
)
and  (Dateleft > dateadd(y,Input_date,-1)
or Dbdate > dateadd(y,Input_date,-1)
or Pdpencomm  > dateadd(y,Input_date,-1)
or Topaid > dateadd(y,Input_date,-1))

0
 
RIASAuthor Commented:
Cheers mate!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now