Compare column values in cross-tab query

Peartree

New member
Local time
Today, 06:39
Joined
Nov 26, 2008
Messages
5
I'm not sure if I'm thinking about this the wrong way - or missing something simple. But hopefully someone can help me out. I have a pretty simple query I'm trying to build essentially from a data set with securities and prices (two tables, both with multiple dates). The results I'm looking for will have the security id's (each are unique) as rows, and then columns will have two dates specified in the query. What I'd like to do is compare the values (difference) from each date.

So for example if stock abc was priced at 10.05 on 6/14/10 and 10.45 on 6/15/10 the query will show abc as a row, the price on 6/14 as first column, the price of 6/15 as second column, and the third column will have 0.4. I have been able to create a crosstab query that shows the prices with columns for 6/14 and 6/15, but I can't figure out how to get a column to calculate the difference.

Any help would be appreciated!
 

Users who are viewing this thread

Back
Top Bottom