CREATE TABLE WeekDay (DeliveryWeekdays INTEGER NOT NULL); INSERT INTO WeekDay(DeliveryWeekdays) values (7);
We have a program that stores an int value in a table with which weekdays you have selected in a check box.
{
None = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 4,
Thursday = 8,
Friday = 16,
Saturday = 32,
Sunday = 64,
}

Ex: If you have checked Monday and Thursday the value is 9 in the field in the table. If you checked Monday, Tuesday, Wednesday the value is 7 in the field and so on..
The question is whether with a date I can check if the day of the week in that date is in the int value stored in the table.
If I check the date 2020-10-08, I see that it is a Thursday. I want to check if Thursday is in value 7. The answer is yes. If the int value is 3, the answer will be no.
Request clarification before answering.
Is this what you're looking for:
select dow(current date) weekday, POWER(2,weekday-2) theday, (if (theday & 0x12) = 0 then 1 else 0 endif)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.