Solved Counting multiple checkboxes (1 Viewer)

June7

AWF VIP
Local time
Today, 14:03
Joined
Mar 9, 2014
Messages
5,466
And if you want to calculate a text label for each row, consider:

IIf([in_mon]=-1,"M","") & IIf([in_tue]=-1,"T","") & IIf([in_wed]=-1,"W","") & IIf([in_thursday]=-1,"Th","") & IIf([in_fr]=-1,"F","") AS Days

This expression would be repeated in the GROUP BY clause.

@MarkK, How did you get the "Copy to clipboard" button in formatted text?
 

KitaYama

Well-known member
Local time
Tomorrow, 07:03
Joined
Jan 6, 2022
Messages
1,540
I think I need to read up on bitmask/bitmath to understand this to be honest, thank you for the additional idea though.
And @theDBguy shows how to use it in a query
 

MarkK

bit cruncher
Local time
Today, 15:03
Joined
Mar 17, 2004
Messages
8,180
@MarkK, How did you get the "Copy to clipboard" button in formatted text?
@June7 I don't understand what you mean, like, what dah what what? Formatted text? Copy to Clipboard? I must have missed something.
Mark
 

June7

AWF VIP
Local time
Today, 14:03
Joined
Mar 9, 2014
Messages
5,466
In your posts. As in Post #9. The formatted code example has a "Copy to clipboard" button.
 

KitaYama

Well-known member
Local time
Tomorrow, 07:03
Joined
Jan 6, 2022
Messages
1,540
@June7 Do you mean like this?
I simply selected code from toolbar while replying.
Code:
test code

2022-07-11_15-03-05.png
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:03
Joined
Sep 21, 2011
Messages
14,238
In your posts. As in Post #9. The formatted code example has a "Copy to clipboard" button.
@June7 The site does that? Here is MarkK's code copied using that button. :)
Code:
SELECT FirstName & ' ' & Lastname As Fullname,  -IsMonday - IsTuesday - IsWednesday - IsThursday - IsFriday As WeekdayCount
FROM YourTable
 

June7

AWF VIP
Local time
Today, 14:03
Joined
Mar 9, 2014
Messages
5,466
Really? I thought I tried the CODE icon. Will have to try again. Thanks.
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:03
Joined
Sep 21, 2011
Messages
14,238
Really? I thought I tried the CODE icon. Will have to try again. Thanks.
Code:
SELECT FirstName & ' ' & Lastname As Fullname,  -IsMonday - IsTuesday - IsWednesday - IsThursday - IsFriday As WeekdayCount
FROM YourTable

I rarely use the code icon, preferring to type code and /code (surrounded by [ & ]) manually. Just tried with the icon General Code though, and that produced the above?
 

Users who are viewing this thread

Top Bottom