The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Sql help, for electronic meter reading


  • Subject: Re: Sql help, for electronic meter reading
  • From: "Graham Kiff" <kiff@xxxxxxxxxxxxx>
  • Date: Tue, 29 Mar 2005 13:45:34 +0100


Hi Paul

I think this should do the trick:

SELECT datepart(hh,Date) AS HourOfDay, Sum(reading) AS Reading
FROM `electric`
where Date between '2005-03-29 00:00:00' and '2005-03-29 23:59:59'
group by datepart(hh,Date)

Cheers
Graham

--------- Original Message --------
From: ukha_d@xxxxxxx
To: ukha_d@xxxxxxx <ukha_d@xxxxxxx>
Subject: [ukha_d] Sql help, for electronic meter reading
Date: 29/03/05 13:36

>
>
>
>
>
>
> Hi Guys,
>
>
>
>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
I'm new
to SQL and have so far managed to get this far.
> Before I get carried away can anyone tell me if there is a better way
of
> doing this.
>
>
>
>
>
> SELECT Sum(reading) AS Reading FROM `electric` where Date between
> '2005-03-29 12:00:00' and '2005-03-29 13:00:00'
>
>
>
> Which returns a sum of the readings between 12:00 and 13:00 What I
want
> to get is a complete list for the last 24 hrs. so I think I need to
> create 24 sql statements. But was wondering if there was a better way.
>
>
>
>
>
> Regards,
>
>
>
> Paul
>
>
>
>
>
> Paul Smith
>
>
>
> Tel:-&nbsp; 0871 425 1236
>
>
>
> This email and any attachments may be confidential and/or privileged.
> Everything is intended for use of the addressee only. If you receive
> this message in error then you must not print it or pass it on to
anyone
> else or use the information it contains.&nbsp; Please inform
Phoenix
> Technology UK&nbsp; of the error by email or by telephoning
(+44)(0)871
425
> 1236.&nbsp; Please then delete all copies from your system.
> If you are not the intended recipient then you must not use the
> information in the message or attachments or allow anyone else to do
so.
> Phoenix Technology UK reserves the right to copy and intercept all
email
> and other data sent over its networks. Phoenix Technology UK cannot
> guarantee that this message has reached you complete and/or virus free
> and advises you to carry out appropriate virus checks.&nbsp; The
Company
does
> not accept any liability for any statements made which are clearly the
> sender's own and not made on behalf of the Company.
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> &lt;*&gt; UKHA_D Mailing list in association with:
> &nbsp;&nbsp;&nbsp;&nbsp; http://www.automatedhome.co.uk
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Sponsor
>
>
>   ADVERTISEMENT
>
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go
to:http://groups.yahoo.com/group/ukha_d/&nbsp;
> To unsubscribe from this group, send an email
to:ukha_d-unsubscribe@xxxxxxx&nbsp;
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

________________________________________________
Message sent using UebiMiau 2.7.2




UKHA_D Main Index | UKHA_D Thread Index | UKHA_D Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.