View Single Post
  #8  
Old April 10th, 2010, 06:12 AM posted to microsoft.public.access.gettingstarted
Seano
external usenet poster
 
Posts: 10
Default How to show time for day's stock market high/low

Forgive my newbie ignorance. I'm not 100% sure what you require, but for this
query the fields I need are [Date],[Time],[High],[Low] which show in the
table:

Date Time Open High Low Close
18/12/2008 3:25:00 PM 3581 3581 3580 3580 18/12/2008 3:26:00
PM 3584 3584 3582 3584
18/12/2008 3:27:00 PM 3584 3587 3584 3584
so every Date (for one day) has 1440 Time intervals of one minute.

I want to find the highest [High] for every day (i.e. 24-hour period) in the
database, and also the [Time] (i.e. one minute period) when that high
occurred.

Ditto for lowest [Low].


"KARL DEWEY" wrote:

You did not respond to John's request -- Could you post the actual
fieldnames of your table, and indicate which field contains the price of
interest?


--
Build a little, test a little.


"Seano" wrote:

Thanks John, the fieldnames are date/time/open/high/low/close/volume for each
minute of the day. Date and time originally came as one field but I separated
them (I could join them again if needed). So I guess I'm looking for the Max
of the high field for the day, and the minute it occurred, and the Min of the
low field, and the minute it occurred.

"John W. Vinson" wrote:

On Thu, 8 Apr 2010 18:20:01 -0700, Seano
wrote:

I've set up a database of stock market intraday data going back two years,
showing Open/High/Low/Close data for every one minute bar of the day. I'm
trying to find 1) the high and low of each day, and 2) the times they
occurred.

Using: Date By Day: Format$([Stock Data].[Date],'yyyy.mm.dd') I can find the
Max of High and Min of Low to give me the day's high and low, but how do I
find the minute these occurred (there may be more than one, so if only one
could be displayed, the first occurence would be best ).

Many thanks


The Format function isn't necessary (or even a very good way to do this): the
DateValue() function will extract just the date portion for grouping. To get
the high for the day and its time you can use a subquery. Could you post the
actual fieldnames of your table, and indicate which field contains the price
of interest? Is there in fact a high/low/open/close field for each *minute*?
And does the field (misnamed, it's a reserved word) Date contain the date and
time?

--

John W. Vinson [MVP]
.