Hi,
I am trying to select some records where the userID=124 and it is in a certain date range - between 1st november 2005 year and 31st october 2006) I am almost there but I have got my brackets in the wrong place so it is returning all records. Have been looking at it all day so a fresh set of eyes would be much appreciated!
Thanks very much
Ed
SELECT CPDID, CPDDate, CPDDescription, CPDPoints, Location, Accredited FROM CPD WHERE UserID=124 AND ((DatePart('m', CPDDate)>10 AND DatePart('yyyy', CPDDate)=2005)) OR (DatePart('m', CPDDate)<11 AND DatePart('yyyy', CPDDate)=2006)
I am trying to select some records where the userID=124 and it is in a certain date range - between 1st november 2005 year and 31st october 2006) I am almost there but I have got my brackets in the wrong place so it is returning all records. Have been looking at it all day so a fresh set of eyes would be much appreciated!
Thanks very much
Ed
SELECT CPDID, CPDDate, CPDDescription, CPDPoints, Location, Accredited FROM CPD WHERE UserID=124 AND ((DatePart('m', CPDDate)>10 AND DatePart('yyyy', CPDDate)=2005)) OR (DatePart('m', CPDDate)<11 AND DatePart('yyyy', CPDDate)=2006)