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




I use something similar to get a list of calls made and received today.
Today being from midnight.

SELECT Type, CID AS Number, Call FROM "Telephone Calls"
where call >= DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)

So using your "stuff"


SELECT (reading) AS Reading FROM electric
where DATE >= DATEADD(dd, DATEDIFF(dd,0,getdate()), 0)

I assume DATE is a field in your db?

Regards

Neil

-----Original Message-----
From: Paul Smith [mailto:ukha@xxxxxxx]
Sent: 29 March 2005 13:37
To: ukha_d@xxxxxxx
Subject: [ukha_d] Sql help, for electronic meter reading


Hi Guys,



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:-  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.  Please inform Phoenix
Technology UK  of the error by email or by telephoning (+44)(0)871 425
1236.  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.  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]






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.