Hello,
All of sudden this sql statement is not working. Pls look this over and see how this can be fixed. Thanks so much for any help
SELECT
Member.membernumber AS id,
Member.LastName,
Member.FirstName,
Member.MiddleName,
Member.NameSuffix,
Member.BirthDate,
Member.DateOfDeath,
Member.DateOf33Degree,
MemValley.ValleySeq AS HomeValley,
v_MemCurrentAddress.BadAddress,
v_MemCurrentAddress.Address1,
v_MemCurrentAddress.Address2,
v_MemCurrentAddress.City,
v_MemCurrentAddress.State,
v_MemCurrentAddress.zip,
v_MemCurrentAddress.Country,
ct_mem_sol.ct_sol,
CASE MemValley.MemValleyStatusID WHEN 1 THEN 'F' ELSE 'T' END as Inactive

FROM
Member
INNER JOIN MemValley on Member.MemberNumber = MemValley.MemberNumber
INNER JOIN v_MemCurrentAddress ON Member.MemberNumber = v_MemCurrentAddress.MemberNumber
LEFT JOIN
(
SELECT
COUNT(*) AS ct_sol,
MemberNumber

FROM
MemSolicitation

GROUP BY
MemberNumber
) AS ct_mem_sol ON Member.MemberNumber = ct_mem_sol.MemberNumber

WHERE
(
(Member.MemberStatusID = 1 and MemValley.MemValleyDegree14StatusID = 10) -- pick out HV
OR (Member.MemberStatusID = 3 and MemValley.MemValleyDegree14StatusID = 20) --
)
AND MemValley.ValleySeq not like 'MA9%'
-- AND Member.MemberNumber='100000148'

ORDER BY
Member.membernumber
;