[AccessD] Count query

Gustav Brock gustav at cactus.dk
Wed Feb 25 11:32:30 CST 2004


Hi Oleg

You could Group By:

  IIf(DateDiff("d", [MS Date Opened], Date()) < 150,
    4, DateDiff("d", [MS Date Opened], Date()) \ 30)

/gustav


> Ahh, they now wont in 2 rows (there also 150 to 179, 180 - 209, aabove
> 210, etc.) one row on target'  the other - behind schedule,, so i guess
> I'have to stick to selecting it by one, then do Union Query

>> Hi Oleg
>>
>> Ahh, got it now, omit the ID:
>>
>> SELECT
>>   Sum(Abs(Not IsNull(FileToSupervisor))) AS CheckedID,
>>   Sum(Abs(IsNull(FileToSupervisor))) AS NotCheckedID
>> FROM
>>   [Ron Data mid AP]
>> WHERE
>>   (Date() - [MS Date Opened] < 149);
>>
>> /gustav
>>
>>
>>> hey Ryan, yeah this one calcualates correctly -- 4 done, 480 to go,
>>> the one below gave 321017 and 25515793...
>>> (they wish they had that many cases) :--)
>>
>>> SELECT
>>>   Sum(ID * Abs(Not IsNull(FileToSupervisor))) AS CheckedID,
>>>   Sum(ID * Abs(IsNull(FileToSupervisor))) AS NotCheckedID
>>> FROM
>>>   [Ron Data mid AP]
>>> WHERE
>>>   (Date() - [MS Date Opened] < 149);




More information about the AccessD mailing list