Skip to Content.
Sympa Menu

freetds - Re: [freetds] Query - Sum(data) by Date?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Зверев Виталий Борисович <VZverev AT genesis.spb.ru>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Query - Sum(data) by Date?
  • Date: Thu, 10 Nov 2005 19:06:25 +0300

Hi Shaun,
it may be done by this:

select Object, sum(Level),convert(nvarchar, Date,107)
from Flow
group by Object, convert(nvarchar, Date,107)

welcome to ANSY SQL ;)

Sincerely yours.
-------------------------------------------------------
Vitaly Zverev, OCP DBA 8&8i
Oracle E-Business Suite &
Infiniband Linux Cluster Administrator
Genesis Ltd., St.Petersburg, Russia



> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Shaun Craig
> Sent: Thursday, November 10, 2005 6:48 PM
> To: FreeTDS Development Group
> Subject: [freetds] Query - Sum(data) by Date?
>
> How do i go about this, i have a single table 'Flow' which
> holds values for a particular object for a date, ie
>
> 'Object' 'Level' 'Date/Time'
>
> Object1 2.0 Nov 09 2005 10:02AM
> Object1 3.3 Nov 09 2005 11:32AM
> Object1 1.2 Nov 09 2005 13:12PM
> etc........
> Object1 3.4 Nov 10 2005 04:12AM
> Object1 0.1 Nov 10 2005 11:23PM
> etc...
>
> I want a query which will sum(level) for each date, so result
> will look like the following
>
> 'Object' 'Total Level for Date' 'Date'
>
> Object1 6.5 Nov 09 2005
> Object1 3.5 Nov 10 2005
>
> Any ideas, had a look on the web but you need to sign up to
> stuff to see solutions, not an option.
>
> Thanks,
>
> Shaun.
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




Archive powered by MHonArc 2.6.24.

Top of Page