skip to Main Content

MySQL get all weekend days between two dates

I'm trying to calculate how many weekend days passed between two dates. SELECT DISTINCT start_date AS fr_date, end_date AS to_date, DATE_FORMAT(start_date, '%a') AS wd_fr, DATE_FORMAT(end_date, '%a') AS wd_to, ( FLOOR(TIMESTAMPDIFF(DAY, start_date, end_date) / 7) * 2 + IF(DATE_FORMAT(start_date, '%w') IN…

VIEW QUESTION

MySQL Exclude values

I have two tables: TESTS: ID YEAR DESCRIPTION 0 2023 some text .. ... ... N 2024 some text test_prep_materials: ID PATH TID 0 /home/user/file0.pdf 0 .. ... ... M /home/user/fileM.pdf 0 So any test have prep materials. And some…

VIEW QUESTION
Back To Top
Search