1

i am using this SQL Statement in PHP:

$sql2="SELECT * from billing_pdf_archive2 where datetime = DATE(NOW() - INTERVAL 14 DAY) and sequence = '".$result["sequence"]."' ";

its working fine however it is only selecting 14 days ago exactly from the datetime field. is there any way i can make it select 14 days ago and older? so 15, 16, 17, 18 days and so on.... but never less that 14 days

1 Answer 1

1

More than 14 days ago:

$sql2="SELECT * from billing_pdf_archive2 where datetime < DATE(NOW() - INTERVAL 14 DAY) and sequence = '".$result["sequence"]."' ";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.