By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,391 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

DateDiff() Calculation

Expert 100+
P: 296
Hi guys. I know I've seen this somewhere, but when I need the answer, I can't seem to find it. This should be relatively simple. I'm trying to add criteria to a query so that it only shows people whose performance review date is within one month. So, it should display all names where [PerformanceReviewDate] is between Today and one month from today. I think I should be using the DateDiff() function, but I've never used it before and am unsure of the syntax. Any guidance would be appreciated. Thanks.
Sep 10 '07 #1
Share this Question
Share on Google+
2 Replies


FishVal
Expert 2.5K+
P: 2,653
Hi guys. I know I've seen this somewhere, but when I need the answer, I can't seem to find it. This should be relatively simple. I'm trying to add criteria to a query so that it only shows people whose performance review date is within one month. So, it should display all names where [PerformanceReviewDate] is between Today and one month from today. I think I should be using the DateDiff() function, but I've never used it before and am unsure of the syntax. Any guidance would be appreciated. Thanks.
Hi, there.

something like this
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl.* FROM tbl WHERE DateDiff("m", Date, tbl.[PerformanceReviewDate])<1;
  2.  
Sep 10 '07 #2

Expert 100+
P: 296
Hi, there.

something like this
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl.* FROM tbl WHERE DateDiff("m", Date, tbl.[PerformanceReviewDate])<1;
  2.  
Worked perfectly! Thanks!
Sep 10 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.