Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assigning Values to Local Variables
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01090351
Message ID:
01090381
Vues:
10
Sergey,

Thank you, but rewrote the query as:
select @LoanAmount=(Select ((loanamount+loanfee)-amtdiscount) from tblloans where id=@LoanID)
I just wanted to place the result of the calculation into the @LoanAmount variable. This basically calculates the loan principal.

Regards,

-R!


>You didn't explain what you want to do. Anyway, see corrections in the code below that will allow to run that select.
>
>>OK, here is the code that is just making my head hurt today:
DECLARE @LoanAmount money
DECLARE @LoanID Int
SET @LoanId=267
--LOAN
select @LoanAmount=((loanamount+loanfee)-amtdiscount) from tblloans where id=@LoanID
>>
>>It keeps giving me the "A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations." error . . . Any alternative way to do this?
>>
Ricardo A. Parodi
eSolar, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform