andybrooke
asked on
Mysql Between 2 dates
Hi,
the below code I want it to bring back records that are basically within the last 14 days. I can bring back current day fine, but when I try to do last 14 days I get records back from last year..
the below code I want it to bring back records that are basically within the last 14 days. I can bring back current day fine, but when I try to do last 14 days I get records back from last year..
SELECT d.clientid,
d.enqid,
d.DMPDate,
d.firstname1,
d.lastname1,
d.AmountOfDeposit,
d.DateOfDepositPaid,
d.1stPayRecDate,
d.WelcomePackDateDMP,
(Select empname from `master`.`tblemployee` where empid = d.enquirytaken),
e.empid,
e.empname,
e.company
FROM `master`.`tblclients` d,
`debtmaster`.`tblemployees` e
where e.empid = d.enquirytakenby
and date_format(d.DMPDate, '%e %M %Y') > (select date_format(CURDATE()-14, '%e %M %Y'))
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER