Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a table having fields as follow
ispaid bit
profilelimit numeric
profilevisited numeric
schemeexpiry datetime

I want to write a simple SELECT query which give me the value of ISPAID according to profilevisited or schemeexpiry.

If Profilevisited is greater than profilelimit or schemeexpiry date is greater than today's date then ispaid should return false otherwise it should come true.

Any help plz.....
Posted

1 solution

hi hiren
I think this will help u :

select case ispaid
when (
select * from [tablename] where Profilevisited >profilelimit and schemeexpiry > getdate()
) then "false"
when (select * from [tablename] where Profilevisited <= profilelimit and schemeexpiry <= getdate()) then "true"
end case

from [tablename]


please reply me on vipsha16.com if this will help u
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900