Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi,i have to do a view but i have problem with query its all about asset.i have table with data as below, table name is assetaable ofc i`ve got about 10k rows in tableASSETID NAMEALIAS ACQUISITIONDATE_W ACQUISITIONPRICE_WGR4-0008184 Zamkniety 2008-03-06 00:00:00.000 2873.920000000000GR4-0009001 Zamkniety 2008-12-31 00:00:00.000 2963.000000000000GR4-0010100 Zamkniety 2005-08-18 00:00:00.000 835.250000000000GR4-0008184 Otwarte 2008-03-06 00:00:00.000 2873.920000000000GR4-0009001 Otwarte 2008-12-31 00:00:00.000 2963.000000000000What i need to do is a view with this data and new column as "currently value".Depreciation is 40 month so if i good think take ACQUISITIONPRICE_w /40= "xxxxxx" its price that should be deduct every month. Then take ACQUISITIONDATE_w and every new month deduct (ACQUISITIONPRICE_w /40= "xxxxxx") and "namealiast" shoul be only 'otwarte'... so easy to say but i have no clue how i can do this