question

zmktwzrd avatar image
zmktwzrd asked

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

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!

computed-columncalculated column
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.