A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

query to find when an event happened



 
 
Thread Tools Display Modes
  #1  
Old December 19th, 2009, 09:42 AM posted to microsoft.public.access.queries
Bob H[_4_]
external usenet poster
 
Posts: 161
Default query to find when an event happened

I have 12 years of weather data in one table, and have queries to give
me total rainfalls between different dates etc, as well as max and min
temperatures.
What I would like now is a query to tell me what date in a selected
range the max or min temperature was.
I have tried the WHERE clause just see what it would return but I got a
syntax error.

Thanks
  #2  
Old December 19th, 2009, 11:11 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default query to find when an event happened

See:
Getting a related field from a GroupBy (total) queryat:
http://www.mvps.org/access/queries/qry0020.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Bob H" wrote in message
...
I have 12 years of weather data in one table, and have queries to give me
total rainfalls between different dates etc, as well as max and min
temperatures.
What I would like now is a query to tell me what date in a selected range
the max or min temperature was.
I have tried the WHERE clause just see what it would return but I got a
syntax error.

Thanks


  #3  
Old December 19th, 2009, 05:51 PM posted to microsoft.public.access.queries
Bob H[_4_]
external usenet poster
 
Posts: 161
Default query to find when an event happened

Thanks for the link, but I can only get as far as the first query, where
it gives me the dates where we had rain, all 1100 of them. I can't
work out how to get the highest value of rainfall along with the date it
fell.

Thanks

Allen Browne wrote:
See:
Getting a related field from a GroupBy (total) queryat:
http://www.mvps.org/access/queries/qry0020.htm

  #4  
Old December 20th, 2009, 04:33 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default query to find when an event happened

In essence, you use a Totals query to get the highest rainfall in the
period.

Then you use a subquery or a DLookup() expression to look up what the date
was that recorded the highest rainfall in the period. If subqueries are the
issue, here's an introduction:
http://allenbrowne.com/subquery-01.html

If you need to use DLookup():
http://allenbrowne.com/casu-07.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Bob H" wrote in message
...
Thanks for the link, but I can only get as far as the first query, where
it gives me the dates where we had rain, all 1100 of them. I can't work
out how to get the highest value of rainfall along with the date it fell.

Thanks

Allen Browne wrote:
See:
Getting a related field from a GroupBy (total) queryat:
http://www.mvps.org/access/queries/qry0020.htm

  #5  
Old December 21st, 2009, 02:01 PM posted to microsoft.public.access.queries
Dale Fye
external usenet poster
 
Posts: 2,651
Default query to find when an event happened

Bob,

It would be helpful if you would post the query you have. Trying to provide
you with a solution, without knowing what you are currently working with is a
real challenge.

----
HTH
Dale



"Bob H" wrote:

Thanks for the link, but I can only get as far as the first query, where
it gives me the dates where we had rain, all 1100 of them. I can't
work out how to get the highest value of rainfall along with the date it
fell.

Thanks

Allen Browne wrote:
See:
Getting a related field from a GroupBy (total) queryat:
http://www.mvps.org/access/queries/qry0020.htm

.

  #6  
Old December 23rd, 2009, 08:14 PM posted to microsoft.public.access.queries
Bob H[_4_]
external usenet poster
 
Posts: 161
Default query to find when an event happened

Dale, I managed to get this problem sorted now, thanks.
I ended up with just a simple query and using SELECT MAX to get what I
wanted. I've also used SELECT MIN for the minimum temperatures.

Thanks anyway

Dale Fye wrote:
Bob,

It would be helpful if you would post the query you have. Trying to provide
you with a solution, without knowing what you are currently working with is a
real challenge.

----
HTH
Dale



"Bob H" wrote:

Thanks for the link, but I can only get as far as the first query, where
it gives me the dates where we had rain, all 1100 of them. I can't
work out how to get the highest value of rainfall along with the date it
fell.

Thanks

Allen Browne wrote:
See:
Getting a related field from a GroupBy (total) queryat:
http://www.mvps.org/access/queries/qry0020.htm

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.