Click here to Skip to main content
15,911,317 members

Comments by Member 11398913 (Top 5 by date)

Member 11398913 23-Aug-19 18:38pm View    
thank alot for your support, i just change the ( IDs ) in code to [ IDs ] and it work now, i really apreciate your help.
Member 11398913 23-Aug-19 8:01am View    
Still not work ? if there any other way , because ther are another paramaters for Where4Crystal string for query.
Member 11398913 1-Aug-19 7:10am View    
i Appreciate your support, thank for all of you for helping...
Member 11398913 31-Jul-19 19:00pm View    
thanks alot for your support, but i have alot of data in my table i cant change the structure i will lose a daa and time to do that, i try this code and its almost work but still total not counting the total days i hope some one help by this last step.
DECLARE @DayCount int =0
DECLARE @DayCount2 int =0
DECLARE @DayCount3 int =0
DECLARE @DayCount4 int =0
DECLARE @DayCount5 int =0
DECLARE @DayCount6 int =0
DECLARE @DayCount7 int =0
DECLARE @Totsi int =0
SELECT
DutyID,Saturday,
Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,
(CASE WHEN Saturday = 'M' THEN @DayCount +1 ELSE @DayCount END) Day1,
(CASE WHEN Sunday = 'M' THEN @DayCount2 +1 ELSE @DayCount2 END) Day2,
(CASE WHEN Monday = 'M' THEN @DayCount3 +1 ELSE @DayCount3 END) Day3,
(CASE WHEN Tuesday = 'M' THEN @DayCount4 +1 ELSE @DayCount4 END) Day4,
(CASE WHEN Wednesday = 'M' THEN @DayCount5 +1 ELSE @DayCount5 END) Day5,
(CASE WHEN Thursday = 'M' THEN @DayCount6 +1 ELSE @DayCount6 END) Day6,
(CASE WHEN Friday = 'M' THEN @DayCount7 +1 ELSE @DayCount7 END) Day7,
SUM(@DayCount + @DayCount2 + @DayCount3 +
@DayCount4 + @DayCount5 + @DayCount6 + @DayCount7) Totals
FROM MATRONDutyView
Group By
DutyID,Saturday,
Sunday,Monday,Tuesday,Wednesday,Thursday,Friday
HAVING
DutyID <> 1 ;
Member 11398913 31-Jul-19 9:44am View    
Thanks ,my table structure is
DutyID , EmpName, Sat,Sun,mon,tus,wed,thu,fri
in every Field the user insert Duty type as letter 'M' for example in 3 or more days
sat 'M'
sun 'M'
mon 'M'
tus 'M'
wed 'A'
thu 'D'
fri 'A'
i want to count if Emp. has more than 3 day duty type 'M'
than show hem Else not showen.
i hope my question is clear cause my english not ok