Query Question

  • Thread starter Thread starter carl
  • Start date Start date
C

carl

I use these 2 queries:

Q1

TRANSFORM Sum(Nz([PC Vol]/2,0)+Nz([BD Vol]/2,0)+Nz([MM Vol]/2,0)) AS
Expr1
SELECT OCC_Data.date, Sum([PC Vol]/2)+Sum([BD Vol]/2)+Sum([MM Vol]/2)
AS OCC_Vol
FROM OCC_Data
WHERE (((OCC_Data.date) Between [BeginDate] And [EndDate]) AND
((OCC_Data.underlying)=[TypeSymbol]))
GROUP BY OCC_Data.date
PIVOT OCC_Data.exchange In ("B","A","P","Z","C","W","I","Q","X");

Q2

SELECT OCC_Data.date AS Expr1, Historical_Symbol.OCC_Vol,
Historical_Symbol.B AS BOX_Vol, (/OCC_Vol) AS BOX, [A]/OCC_Vol AS
AMEX, [P]/OCC_Vol AS ARCA, [Z]/OCC_Vol AS BATS, [C]/OCC_Vol AS CBOE,
[W]/OCC_Vol AS C2, /OCC_Vol AS ISE, [Q]/OCC_Vol AS NOM, [X]/OCC_Vol
AS PHLX
FROM Historical_Symbol
ORDER BY Historical_Symbol.date;


I was trying to find a way to display in the results the symbol that
was inputed ((OCC_Data.underlying)=[TypeSymbol]).

Thank you in advance.
 
TRANSFORM Sum(Nz([PC Vol]/2,0)+Nz([BD Vol]/2,0)+Nz([MM Vol]/2,0)) AS
Expr1
SELECT OCC_Data.date

, [Type Symbol]

, Sum([PC Vol]/2)+Sum([BD Vol]/2)+Sum([MM Vol]/2)
AS OCC_Vol
FROM OCC_Data
WHERE (((OCC_Data.date) Between [BeginDate] And [EndDate]) AND
((OCC_Data.underlying)=[TypeSymbol]))
GROUP BY OCC_Data.date, [Type Symbol]
PIVOT OCC_Data.exchange In ("B","A","P","Z","C","W","I","Q","X");



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top