Hi,
Im trying to get the depreciation value of an equipment every month. My system gets the number of months from date of purchased up to current date for the computation of depreciation. I can run the report anytime but the computation must be like this:
Sample:
Date purchased January 1-15 : When I run the report for January, there should be 1 month depreciation, 2 months for the month of Feb etc.
Date purchased January 16-31 : When I run the report for January, No depreciation yet, 1 month for the month of Feb, 2 months for March, etc.
Date Purchased Feb 1-15 : When I run the report for January, Should not be displayed, then 1 month depreciation for the month of Feb.
The Idea is if the equipment is bought from 1-15 it should have 1 month depreciation after the end of that month while those bought from 16-31, it should be counted the following month
Im using this in the select statement to compute for the month but not satsfying the above condition
DATEDIFF(MONTH, (CONVERT(Datetime, [Item].[Dpchsed],101)), GETDATE()) AS [Depreciated Months]
I already got the computation for depreciation, I just need how to compute the number of months from the condition above. Im using vb.net and sql server 2008 r2
Thanks for helping