Obtain data for the quarter and 10 days more

1

I need to be able to obtain the information of a mysql table corresponding to a quarter and the 10 days immediately following. Example, data for the first quarter of the year = January + February + March + 10 first days of April.

I'm using the mysql quarter function:

select * from  tabla where quarter(fecha)=1

with that I have the data for the quarter, but how do I include the other 10 days?

    
asked by daniel2017- 26.04.2017 в 18:48
source

1 answer

1

and if you add to the query

or (fecha BETWEEN '2017-04-01 00:00:00' AND '20107-04-10 23:59:59')

Keep in mind that if you do not know what room you are looking for, and you pass it as a parameter, you will have to pass the month as parameter as well.

You could also use the day, month and year functions to build a slightly more complex query but with the same functionality.

    
answered by 26.04.2017 / 18:53
source