[AccessD] SQL Running Sum - 2

Gustav Brock Gustav at cactus.dk
Fri Dec 14 04:04:24 CST 2007


Hi Eoin 

It could be that some fields contain Null. Try this:

  Sum(IIf(Nz(W.ClientID, 0) > 0, Nz(W.WorkHours, 0),0)) AS ClientHours

/gustav

>>> ebairead at gmail.com 13-12-2007 22:12 >>>
in a query

On 13/12/2007, Charlotte Foust <cfoust at infostatsystems.com> wrote:
>
> Where are you trying to do this, in a form, report, or query?
>
> Charlotte Foust
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:
> accessd-bounces at databaseadvisors.com] On Behalf Of Eoin C. Bairéad
> Sent: Thursday, December 13, 2007 10:13 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] SQL Running Sum - 2
>
> hi
>
> I see nothing in the SQL book to tell me that the following is
impossible,
> but it won't compile.
>
> Sum(IIf(W.ClientID >0, W.WorkHours,0)) AS ClientHours,
>
> is there a problem with a conditional running sum.
>
> Eoin
> --
> --
> Eoin C. Bairéad
> Dublin, Ireland
> Áth Cliath, Éire




More information about the AccessD mailing list