Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

How To Get Old And New Values If They Exists On Particular Date

$
0
0
DateTemperatureOldTemperatureNewTemperature
12-May-1235Some Value before 12 May35
13-May-12403540
14-May-12104010
15-May-120100
17-May-1217017
18-May-120170
20-May-1225025
21-May-12342534

Hi Please see above Data. We will be capturing daily temperatures, some days there are chances of not capturing due to some reasons. Ex: 16-May-2012,19-May-2012 is not captured in above table. 

Now I have to generate report with date as parameter to it. Report should have Columns like ReportDate,OldTemperature,NewTemperature. Let me explain how values will be populated.

If report parameter's date has data captures on particular date we should populate NewTemperature=IFEXISTS(ReportParameter's temperature),OldTemperature ReportParameter's IFEXISTS(previous date temperature) if there is no data capture on report parameter date then IFEXISTS(previous day's temperature) will be NewTemperature, IFEXISTS(the previous temperature of NewTemperature) will be OldTemperature.

Can You Please guide me how to get these data using sql server 2005


Thanks & Regards, Sunil A.


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>