Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    17

    Question Unanswered: Monthly Report Based on Hourly Data

    I've got a data table with temperature data that's being collected once an hour around the clock. The data looks like this (imagine that there are 2 columns - 1 called Date and 1 called Temperature:
    Date -----------------Temperature
    5/5/1999 0:29:00---6.6
    5/5/1999 1:29:00---6.8
    5/5/1999 2:29:00---6.6
    5/5/1999 3:29:00---6.51
    ...and it goes on like this for the entire year.

    I want to run a query or VBA script that will give me summaries of this data. For example, how would I write a query or VBA script that will return the MAX temperature recorded in May? Ideally, this same query will work on temperature readings from other years so that if I'm working with temperatures recorded in 2003, I won't have to re-write the scripts. Is that possible? I tried doing a
    SELECT MAX(Temperature) from DataTable
    WHERE [Date] LIKE '5/%'
    but that didn't work at all. Any ideas? Thanks a lot for your help!

  2. #2
    Join Date
    Jan 2004
    Posts
    17

    Re: Monthly Report Based on Hourly Data

    I got it:
    SELECT Max(Temperature) AS MaxOfTemp FROM DataTable
    WHERE Month([Date])=5;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •