I have two tables A and B
Table A
Name Time Price
a 12/01/2011 12:01 1.2
a 12/01/2011 12:02 1.3
a 12/01/2011 12:03 1.7
Table B
Name Date Factor_P Factor_Q Factor_R
a 12/01/2011 0.234 1.456 1.445
a 12/02/2011 0.345 1.222 1.765
I need to do a
Select Price * (Factor_P * Factor_Q / Factor_R) from Table A where Name = 'a' and Time > '12/01/2011 09:30' and Time < '12/01/2011 16:00'
I need to fetch the three factors from Table B and do the multiplication. How do I do the multiplication with multiple values from another table after matching the date?
Try this: