Link to home
Create AccountLog in
Avatar of andybrooke
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..
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'))

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of andybrooke
andybrooke

ASKER

Thanks!