Hi,
I have a follow up on a question I posted a few weeks ago. What I'm trying to do is find all the records that are >= minus one month from a user entered date. My data goes starts at 1/1/02 and goes through 12/1/03. FYI, the field "BeginDate" always starts on the 1st of the month, hence the '1' in the Date Format. This query doesn't work for a January start date. I think I know why it's not working (1-1= month "0": not possible), but I can't think of what to do...Is there an easy way to fix this? Thanks in advance!
Shivani
SELECT tblEntitlement.EntitlementID, tblEntitlement.BeginDate, tblEntitlement.EndDate
FROM tblEntitlement
WHERE (((tblEntitlement.BeginDate)>=Format(DatePart("m",[Enter start date])-1 & "/" & "1" & "/" & DatePart("yyyy",[Enter start date]),"Short Date"
));
I have a follow up on a question I posted a few weeks ago. What I'm trying to do is find all the records that are >= minus one month from a user entered date. My data goes starts at 1/1/02 and goes through 12/1/03. FYI, the field "BeginDate" always starts on the 1st of the month, hence the '1' in the Date Format. This query doesn't work for a January start date. I think I know why it's not working (1-1= month "0": not possible), but I can't think of what to do...Is there an easy way to fix this? Thanks in advance!
Shivani
SELECT tblEntitlement.EntitlementID, tblEntitlement.BeginDate, tblEntitlement.EndDate
FROM tblEntitlement
WHERE (((tblEntitlement.BeginDate)>=Format(DatePart("m",[Enter start date])-1 & "/" & "1" & "/" & DatePart("yyyy",[Enter start date]),"Short Date"