guys, is it possible to populate a part of sql statement or query from a textbox where it is controlled by the user.
this is the query
SELECT ContractID, Contract.Tenure, Contract.BeginningBalance, Contract.FixedInterestRate, ReceivedDate AS DateFrom, DATEADD(M, 1, ReceivedDate) AS DateTo,
AVG(AveDailyRate.InterestRate) AS AverageDailyRate,
Contract.BeginningBalance + (Contract.BeginningBalance * (Contract.FixedInterestRate/12) * AVG(AveDailyRate.InterestRate)) AS MonthlyAmortization,
'2011-01-19' AS AsOfDate
FROM Contract INNER JOIN AveDailyRate ON Contract.Tenure = AveDailyRate.Tenure
WHERE
Contract.ReceivedDate <= '2011-01-19'
AND (AveDailyRate.Date >= Contract.ReceivedDate AND AveDailyRate.Date <= '2011-01-19')
GROUP BY ContractID, Contract.Tenure, Contract.BeginningBalance, Contract.FixedInterestRate, ReceivedDate
ORDER BY Contract.ContractID
look at the pic
Go to the complete details ...