var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: using Computed Column in the Query
need help ,
i have a table called "Loans" where i need to compute a column i.e. NoofDays based on which other calculation like interest calculation needs to be done.
my query goes like this
"select datediff(dd,VDate, MDate) as NoOfDays ,NoOfDays * Principal * Rate /100 * 365 from Loans".
if i run the above query it says
"Invalid column name 'NoOfDays'".
this executes fine if i use Access but not in SQL Server.
can anybody say what might be the problem and how i can solve it.
select datediff(dd,VDate, MDate) as NoOfDays ,datediff(dd,VDate, MDate) * Principal * Rate /100 * 365 from Loans
select q.NoOfDays,q.NoOfDays * q.Principal * q.Rate /100 * 365
(select datediff(dd,VDate, MDate),Principal,Rate from Loans) as q