Try
SELECT Sum(litresPumped) AS sLitersPumped
WHERE session IN (1,2,3)
Just Change out the (1,2,3) with some variable that is a comma delimited list of the
sessions you wish to sum up.
Jim Nitterauer
http://www.creativedata.net
---------- Original Message ----------------------------------
From: John McCosker <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Sat, 17 Feb 2001 18:48:28 -0000
>OK can anyone help with this little sql problem.
>
>OK I have built a site that is monitoring reservoir in Co.Donegal, Ireland.
>
>The reservoir has a pump which basically fills up the reservoir to the
>required level.
>
>During this event for however long, an hourly signal is sent with the
>flowrate (litres pumped in) for that hour.
>
>So if it takes 4 hours to get it back up to the required level there a four
>records in the database of hourly flow levels.
>
>When the pump starts to pump its sends an email to our server so then we
>create a session state for that activity.
>
>So, how do I add up all those records.
>
>I can
>
>SELECT litresPumped, pumpSession
>WHERE session = 1
>
>To get the beginning
>
>and
>
>SELECT pumpsession
>WHERE session = 0
>
>To get the end
>
>How do I do this or is there a simple way
>
>John Northern Ireland
>
>Derry
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists