getting one day timestamp in mysql Please consider the following stored procedure I have:

ORIGINAL Stored Procedure:

-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$

CREATE PROCEDURE `myProc`()
BEGIN

DECLARE EXIT HANDLER FOR SQLEXCEPTION,SQLWARNING

BEGIN
  -- ERROR
ROLLBACK;

END;

START TRANSACTION;

INSERT INTO mydb.mytable(some values)

SELECT (some values)

FROM   mydb.mytable

WHERE m_dt BETWEEN  CURDATE() - INTERVAL 60 DAY AND CURDATE() - INTERVAL 60;

DELETE FROM   mydb.mytable

WHERE m_dt BETWEEN  CURDATE() - INTERVAL 60 DAY AND CURDATE() - INTERVAL 60;

COMMIT;

END


Since m_dt datatype is datetime, I want to modify my BETWEEN condition. I want to add 00:00:00  before the AND and 23:59:59 after the AND condition. For example something like the following:

WHERE m_dt BETWEEN  CURDATE()  - INTERVAL 60 DAY 00:00:00 AND CURDATE() - INTERVAL 60 23:59:59;

By any chance it is possible in MySQL?
Try this

I believe the first part already evaluates to 00:00:00. So I just added the seconds in.

WHERE m_dt BETWEEN  (CURDATE() - INTERVAL 60 DAY) AND 
  (DATE_ADD((CURDATE() - INTERVAL 60 DAY),INTERVAL 86399 SECOND))