Solved

sql query with criteria

Posted on 2011-09-16
5
307 Views
Last Modified: 2012-06-27
Hi,

Cheers
0
Comment
Question by:RIAS
  • 3
5 Comments
 
LVL 31

Expert Comment

by:James Murrell
ID: 36550035
http://www.sql-tutorial.net/ may help but as you didn't post a question it would be impossible to provide answer
0
 

Author Comment

by:RIAS
ID: 36550055
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
 

Author Comment

by:RIAS
ID: 36550075
I tried attaching the query in code but it didnt get updated.Sorry about that.
0
 
LVL 7

Accepted Solution

by:
twol earned 500 total points
ID: 36550219
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
 

Author Closing Comment

by:RIAS
ID: 36553862
Cheers mate!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question