Jump to content

marky7890

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

marky7890's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks everyone for your help, jcbones your solution worked great.
  2. Here it is: `Date` date NOT NULL, `TempMin` decimal(5,1) NOT NULL, `TempMinTime` time NOT NULL, `TempMax` decimal(5,1) NOT NULL, `TempMaxTime` time NOT NULL, `DewPtMin` decimal(5,1) NOT NULL, `DewPtMinTime` time NOT NULL, `DewPtMax` decimal(5,1) NOT NULL, `DewPtMaxTime` time NOT NULL, `HumMin` decimal(5,1) NOT NULL, `HumMinTime` time NOT NULL, `HumMax` decimal(5,1) NOT NULL, `HumMaxTime` time NOT NULL, `WdChill` decimal(5,1) NOT NULL, `WdChillTime` time NOT NULL, `PressureMin` decimal(5,1) NOT NULL, `PressureMinTime` time NOT NULL, `PressureMax` decimal(5,1) NOT NULL, `PressureMaxTime` time NOT NULL, `WindGust` decimal(5,1) NOT NULL, `WindGustDir` decimal(5,1) NOT NULL, `WindGustTime` time NOT NULL, `WindSpeed` decimal(5,1) NOT NULL, `WindSpeedDir` decimal(5,1) NOT NULL, `WindSpeedTime` time NOT NULL, `Windrun` decimal(5,1) NOT NULL, `RainRate` decimal(5,1) NOT NULL, `RainRateTime` time NOT NULL, `RainTotal` decimal(5,1) NOT NULL, `SnowTotal` decimal(5,1) NOT NULL, `WindDomDir` varchar(11) NOT NULL, UNIQUE KEY `Date` (`Date`),
  3. Hello, I am trying to display rainfall totals for the year so far in a table with months going across and days going down. Like so: -- Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1 2 3 4 5 6 7 8 etc And then have the rainfall totals for each day in the table, I am quite experienced with PHP however I cant work out how I would do this The data is stored in a mysql table called "wx_daily", and the rainfall column is called" RainTotal". The dates are stored in the "Date" column in mysql Date format. Im using the following mysql query: SELECT * FROM wx_daily WHERE YEAR(Date) = '2011' ORDER BY Date Asc Thanks, Mark
  4. This almost worked just needed to add an order tag for the second select: select Date, TempMax from (SELECT Date, TempMax FROM wx_daily ORDER BY TempMax Desc LIMIT 10) as temps order by temps.Date desc limit 1 Thanks for all your help everyone.
  5. The date field is already in MySQL Date format, I just showed it wrong in my example. I tried your ideas but they just showed the ordered list of the 10 highest temperatures.
  6. Hi, I'm having trouble working out how to do the following: So I have a weather station and the extremes for each day are stored in a MySQL database. I'm planning on having a page showing the 10 highest and lowest temperatures, wind guests, etc. This uses the query: SELECT Date, TempMax FROM wx_daily ORDER BY TempMax DESC LIMIT 0 , 10 This will output something like this (example data): 2009/06/17 | 22.3 2010/05/30 | 22.0 2011/08/06 | 21.7 2010/07/04 | 21.4 2009/06/14 | 21.0 2011/05/24 | 20.0 2010/08/16 | 19.8 2011/05/15 | 19.6 2009/08/02 | 19.1 2010/06/09 | 18.7 I now want to find the newest record from the above results (2011/08/06), this is where I got stuck. Any Ideas on how to do this? Thanks, Mark
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.