Quantcast
Channel: Questions in topic: "calculated column"
Viewing all articles
Browse latest Browse all 11

How do i write a computed column from two tables with separate dates?

$
0
0

In SQL Server I create a separate/new table of many indicator values every trading day. I want to know the daily net change between them. In other words, a computed column where the net change in the "indicator" = today's indicator value (in table one) minus yesterdays indicator value (in table two). Instead of having to specify the exact date(s) I only want the latest dates so something like the difference between (maxdate, indicator value from table one) minus ((maxdate minus one), indicator value from table two) and so on. Thanks for any help!


Viewing all articles
Browse latest Browse all 11

Trending Articles