Hi
I'm having a small issue with the below code and I have noidea what I am doing wrong. It keeps telling me I have a syntax error.
Can anyone shed some light on what I am doing wrong.:banghead:
I am trying to count the different genders over a selected period of time and I want to change anything from F to Female and count all those with f or Female as one group and likewise for M to Male and all Male as one group
Thanks in advance.
select count(ClientID) as ClientCount, GenderGroup
from
(
select distinct
ClientID,
switch
(
Gender" = F, "Female",
Gender = M, "Male"
) as GenderGroup
from
(
select tclientinfo.ClientID, tclientinfo.Gender, tclientservices.[Service Date]
from TClientServices , TClientInfo
where tclientservices.ClientID = tclientinfo.ClientID
and (StartDate <= [Service Date] and [Service Date] <= EndDate)
) C
)
group by GenderGroup
I'm having a small issue with the below code and I have noidea what I am doing wrong. It keeps telling me I have a syntax error.
Can anyone shed some light on what I am doing wrong.:banghead:
I am trying to count the different genders over a selected period of time and I want to change anything from F to Female and count all those with f or Female as one group and likewise for M to Male and all Male as one group
Thanks in advance.
select count(ClientID) as ClientCount, GenderGroup
from
(
select distinct
ClientID,
switch
(
Gender" = F, "Female",
Gender = M, "Male"
) as GenderGroup
from
(
select tclientinfo.ClientID, tclientinfo.Gender, tclientservices.[Service Date]
from TClientServices , TClientInfo
where tclientservices.ClientID = tclientinfo.ClientID
and (StartDate <= [Service Date] and [Service Date] <= EndDate)
) C
)
group by GenderGroup