Click here to Skip to main content
15,560,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,
for my application i want to retrive the details based on Loan_Type

and i will get details by checking getdate() in between Valid_From and Valid_To and
also i want to retrive the data when Valid_To != null also
SQL
SELECT ID,
       Nature_Vehicle,
       Loan_Terms,
       Loan_Name,
       Interest_Rate,
       Interest_Type,
       Period_Type,
       Period_Value,
       Processing_Fee,
       Late_Repayment_Charges,
       Penal_Interest,
       Liability_Type,
       Required_Liability_Amount,
       Grace_Period,
       Mode_Repayment,
       Initial_Payment_Loan,
       Type_Property,
       From_Date,
       LockIn_Period,
       PrePayment_Interest,
       Is_Active,Valid_From ,Valid_To
 FROM Loan_Type WHERE Loan_Type = 1  AND GETDATE() BETWEEN Valid_From AND Valid_To 


?????????
Posted
Updated 8-Aug-12 23:58pm
v2

SQL
SELECT ID,
Nature_Vehicle,
Loan_Terms,
Loan_Name,
Interest_Rate,
Interest_Type,
Period_Type,
Period_Value,
Processing_Fee,
Late_Repayment_Charges,
Penal_Interest,
Liability_Type,
Required_Liability_Amount,
Grace_Period,
Mode_Repayment,
Initial_Payment_Loan,
Type_Property,
From_Date,
LockIn_Period,
PrePayment_Interest,
Is_Active,Valid_From ,Valid_To
FROM Loan_Type WHERE Loan_Type = 1 AND GETDATE() BETWEEN Valid_From AND Valid_To and Valid_To is not null
 
Share this answer
 
SQL
ELECT ID,
       Nature_Vehicle,
       Loan_Terms,
       Loan_Name,
       Interest_Rate,
       Interest_Type,
       Period_Type,
       Period_Value,
       Processing_Fee,
       Late_Repayment_Charges,
       Penal_Interest,
       Liability_Type,
       Required_Liability_Amount,
       Grace_Period,
       Mode_Repayment,
       Initial_Payment_Loan,
       Type_Property,
       From_Date,
       LockIn_Period,
       PrePayment_Interest,
       Is_Active,Valid_From ,Valid_To
 FROM Loan_Type WHERE Loan_Type = 1  AND GETDATE() BETWEEN Valid_From AND Valid_To 
AND Valid_To IS NOT NULL
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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