Query Between 2 numbers ("dates")

C

carl

I am using this query...

TRANSFORM Sum(Nz([PC Vol]/2,0)+Nz([BD Vol]/2,0)+Nz([MM Vol]/2,0)) AS
Expr1
SELECT Sum([PC Vol]/2)+Sum([BD Vol]/2)+Sum([MM Vol]/2) AS OCC_Vol
FROM OCC_Data
WHERE (((OCC_Data.date)>=[EnterDate yyyymmdd]) And ((OCC_Data.Product)
In ('OSTK','OIND')) And OCC_Data.underlying Not In
('VIX','SPX','OEX','DJX'))
GROUP BY date
PIVOT OCC_Data.exchange In ("A","B","C","I","P","Q","W","X","Z");

My date field is long integer - not sure why - inherited that way.

Can the query be modified to check between 2 'dates" - for example
between 20110401 and 20110421 ?

Thank you in advnace.
 
M

Marshall Barton

carl said:
I am using this query...

TRANSFORM Sum(Nz([PC Vol]/2,0)+Nz([BD Vol]/2,0)+Nz([MM Vol]/2,0)) AS
Expr1
SELECT Sum([PC Vol]/2)+Sum([BD Vol]/2)+Sum([MM Vol]/2) AS OCC_Vol
FROM OCC_Data
WHERE (((OCC_Data.date)>=[EnterDate yyyymmdd]) And ((OCC_Data.Product)
In ('OSTK','OIND')) And OCC_Data.underlying Not In
('VIX','SPX','OEX','DJX'))
GROUP BY date
PIVOT OCC_Data.exchange In ("A","B","C","I","P","Q","W","X","Z");

My date field is long integer - not sure why - inherited that way.

Can the query be modified to check between 2 'dates" - for example
between 20110401 and 20110421 ?


WHERE [date] Between [Enter start date yyyymmdd] And [Enter
end date yyyymmdd] And Product In('OSTK','OIND') And
underlying Not In('VIX','SPX','OEX','DJX')
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query Question 3
Query Question 0
Another Query Modification Question 6
Query Question 1
Query Question / 4
Query Help Needed 8
Reduce # of date columns in crosstab query 4
Another Date Query 2

Top