Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
IOU
Create table Debts ( InitialDebt DECIMAL(6,2), InitialDate DATETIME, CurrentDate DATETIME, Interest DECIMAL(6,2) ) Insert Debts (InitialDebt, InitialDate, CurrentDate, Interest) SELECT 33, '09/06/2019', GETDATE(), 10 ALTER TABLE dbo.Debts ADD CalculateDebt AS (InitialDebt + (InitialDebt*Interest/100/DAY(EOMONTH(GETDATE()))) * DATEDIFF(DD, InitialDate, CurrentDate)) SELECT InitialDebt, InitialDate, CurrentDate, DATEDIFF(D, InitialDate, CurrentDate) as PayableDays, Interest, DAY(EOMONTH(GETDATE())) as DaysInMonth, CAST(CalculateDebt AS DECIMAL(6,2)) as PayToCreditor FROM Debts
run
|
edit
|
history
|
help
0
DBMS ca2
newtable
Calculation of a status life duration
Items
forming date as nvarchar
product_sales
Sample of Update~Delete with OUTPUT clause (2016 >)
mySQL_Glx_12dec
Rno 37 boat
Recursive cte (common table expression)