Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 595
  • Last Modified:

Date Subtraction in Access2007 Query, then show >30 and <60 days

I work in a law firm and trying to develop a MS 2007 Access query that will help us determine how long a case has been opened.  The main table has a column called "Date Opened".  Part One: In my query, I have selected "Date Opened" and then wrote the Expression of "Expr1: DateDiff("d",[Date Opened],[Now]).  When I run the query, I have to manually enter today's date, the 'Now'.  Doesn't Access already know today's date and can it run without asking me?    Part Two:  How can I get the query to only return case open dates of greater than 30 but less than 60 (but not equal to) days?   Thank you.
0
James0903
Asked:
James0903
  • 4
  • 2
1 Solution
 
Rey Obrero (Capricorn1)Commented:
try this


DateDiff("d",[Date Opened],Now())

or


DateDiff("d",[Date Opened],Date())
0
 
Rey Obrero (Capricorn1)Commented:

Field      DateDiff("d",[Date Opened],Date())



criteria Between 30 and 60



or this one

Field      DateDiff("d",[Date Opened],Date())



criteria Between 31 and 59
0
 
James0903Author Commented:
Capricorn1, thank you.  Is there a way to run query without manually inputting a date?  Thank you.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
Rey Obrero (Capricorn1)Commented:
seen my post?  what date are you referring to?
0
 
James0903Author Commented:
Yes, saw the post.  Please excuse, I was unclear.  Each time I run the query I need to input today's date, correct?  There isn't a way to just click on the query and press 'Run' without inputting a date?  Thank you.
0
 
Rey Obrero (Capricorn1)Commented:
you don't need to enter the date, if you use the format i posted above.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now