[AccessD] Count query

paul.hartland at fsmail.net paul.hartland at fsmail.net
Wed Feb 25 10:12:00 CST 2004


Oleg,
If the FileToSupervisor contains the same value when not null, you could try this:
SELECT Count([Ron Data mid AP].ID) AS CountOfID
FROM [Ron Data mid AP]
WHERE (((Date()-[Ron Data mid AP].[MS Date Opened])<149))
GROUP BY [Ron Data mid AP].FileToSupervisor;

Paul



Message date : Feb 25 2004, 04:09 PM
>From : Oleg_123 at xuppa.com
To : accessd at databaseadvisors.com
Copy to : 
Subject : Re: [AccessD] Count query
Hi Gustav,

i need a count, not a sum :--)
when i am trying count this way -- i just get a same number in both columns.
I don't think Union Query would work here

SELECT Count((Not IsNull(FileToSupervisor))) AS CheckedID,
Count((IsNull(FileToSupervisor))) AS NotCheckedID
FROM [Ron Data mid AP]
WHERE (((Date()-[MS Date Opened])<149));



> Hi Oleg
>
> How about this:
>
> 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);
>
> /gustav
>
>
>> Is it possible for one query to count how many records are up to 150
>> days old and have been chechked and the ones that haven't ? I
>> understand how to do in 2 queris, i am wondering if its possible to do
>> in one
>
>> thanks,
>> Oleg
>
>> SELECT Count([Ron Data mid AP].ID) AS CountOfID
>> FROM [Ron Data mid AP]
>> WHERE (((Date()-[Ron Data mid AP].[MS Date Opened])<149))AND (([Ron
>> Data mid AP].FileToSupervisor) Is not Null));
>
>> SELECT Count([Ron Data mid AP].ID) AS CountOfID
>> FROM [Ron Data mid AP]
>> WHERE (((Date()-[Ron Data mid AP].[MS Date Opened])<149))AND (([Ron
>> Data mid AP].FileToSupervisor) Is Null));
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com





-----------------------------------------
Get Breaking News from CNN, ABC, NBC, CBS Now.
http://www.xuppa.com/news/?link=webmail


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
Freeserve AnyTime - HALF PRICE for the first 3 months - Save £7.50 a month 
www.freeserve.com/anytime


More information about the AccessD mailing list