Hello i am trying to use the 2 DISTICT and COUNT together in the same query, which i use to count the number of records presents in db, but can t get
I am able to use the distinct to eliminate DUPLICATE recors, but when try to use count somehting go wrong
So at the moment i have to build another query that count hte 1 query
I have the query DATETQ2
Code:
SELECT DISTINCT date_trattamenti.ID, anagrafica.SESSO
FROM anagrafica INNER JOIN date_trattamenti ON anagrafica.Id = date_trattamenti.ID
GROUP BY date_trattamenti.ID, anagrafica.SESSO, date_trattamenti.dal
HAVING (((anagrafica.SESSO) Like "Femmina") AND ((date_trattamenti.dal) Between #1/30/2018# And #12/30/2018#));
that acccording to those date(later i ll make them variabile), select
all the user that has been treated during that period selected for sex, male and female, in this case Female (anagrafica.SESSO) Like "Femmina)
There are 2 table, one is Date_trattamenti with ID, FROM,TO, the last 2 are the date of start and end of treatment
The other table is ANAGRAFICA, with detail of the patient
Now with th e previous query i count all the female tretaed oin that range of time
I want to count them in the same Query instead of using another query to do
Code:
SELECT Count(dateTQ.ID) AS ConteggioDiID
FROM dateTQ;
CONTEGGIO=COUNT
how can i do that?
thanks a lot