Skip to content
Advertisement

get the scheduling data based on 3 years in mysql

I have one table bibles that having two columns only i.e. is below:-

Bible Scheduling starts from 5 sept 2021 for 3 years and ends on 31 Aug 2024 i.e basically bible repeats three time in 3 years.

Now Suppose today date is 8 Sept 2021

So now requested date is 8 spet 2021 i want to fetch the 4th record Mathews 4 and now suppose today date is 6 sept 2022 and now want to fetch the 3 row Mathews 3.

Note : these date columns are not stored in database. i have only two columns id, chapter_name.. Reason for not storing the dates because after three years i need to update again that dates to make scheduling works. Is there any way to fetch the rows?

Below answer works fine but I have two types of Bibles that starts from Id 1 to 364 another starts from 365 to 1456… 1st case 1 to 364 works.. but 365 to 1456 not works

Advertisement

Answer

If I understand correctly, then logic you want is:

The ? is a parameter for the date you pass in.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement