Skip to content
Advertisement

Generate date from sunday except the existing value, in 1 Week Range

This is the result of my query right now with data getting 1 result only.

enter image description here This is my query:

$merid=20;

I am trying to populate to get the dates the full week beginning Sunday except the existing Tuesday .


enter image description here

Can someone give guidelines on where to begin? Is the logical process can be done here in SQL or do I need to create the logic using PHP?

Advertisement

Answer

You can use a recursive subquery to generate the datename you want:

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