database query in T-SQL

July 11, 2017 at 10:15:48
Specs: Windows 7
I want to extract a query from our database where I need to calculate the balance of each account after 6 months of their account creation date. Let's say someone joined on 10th jan'17 and i need to find out his balance on 10th Jul. So between 2016 and 2017 who opened account , i need to find out their balance after 6 months. I think of using for loop and i have got a predefined stored proc which can calculate balance as at a specific date. But not sure how i build the sql code? please help me give input.
Account Account_start_date balance = Account_start_date+dateadd(month,6,Account_start_date). these 3 field only required.

See More: database query in T-SQL

Reply ↓  Report •
Related Solutions


Ask Question