Solved

sql query with criteria

Posted on 2011-09-16
5
289 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now