Question: How to set up a variable on the root directory for the url link in ColdFusion?

I set up the variable on the root directory for the url link, appweb\instance.cfm:

```
<CFSCRIPT>
 ...
 ...     
  Application.MainLink = "http://www.ucdavis.edu/index.html";

</CFSCRIPT>

```

I have a file under appweb/costsharing/footer.cfm to use the variable for url link, but it doesn't work. 

```
<br />
<br />
<div align="center">
<b>Need Help?  Visit the <a href="#Application.MainLink#" target=_blank>Cost    Sharing Help</a></b>
</div>
<br />
<br />
<CFInclude Template="../OnRequestEnd.cfm">

</body>
</html>

```

Any suggestion?

Answer: 
I don't really see much of a way around a self join. Here is how it would work:

```
select a.date
  , a.item
  , sum(a.sales) - sum(b.sales) as DailyDelta
from table a
  join table b on a.product = b.product
    and b.date = dateadd(day, -1, a.date)
group by a.date
  , a.item

```

Not great performance wise but it will get the job done.
Try this..

SELECT date, 

```
  ( sum(sales) - LAG(sum(sales),1,0) over (order by sales) ) as dailyDelta

```

FROM Table

group by date

order by date;