BleepingComputer.com: Access Query Help

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Access Query Help Simple Query Question

#1 User is offline   b2dan 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 1
  • Joined: 26-September 07

Posted 26 September 2007 - 09:44 AM

Hi, Just trying to make a database in Access that'll allow the user to run a query and find out all records that are 10 years or older i.e. a piece of equipment that was last serviced in May 1997 requires servicing and once that was done in november 2005 doesn't. Also, is it possible to write a line into another query that will bring up items that are nearing the replacement date? Sorry if this is simple, but i've lost track of access and forgotten it since I left college!

Dan

#2 User is offline   tos226 

  • BleepIN--BleepOUT
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 1,423
  • Joined: 21-October 04
  • Gender:Female
  • Location:LocalHost

Posted 26 September 2007 - 02:53 PM

In the query design view, select the fields you want to see.
Under the first four lines are rows for multiple selection criteria.
Just as a quick way to get you started,

under a date you can enter things such as ">=Now()-7" to get records for the last week.
"<=Now()-364.25*2" will return records roughly over 2 years old or if you're fancy, ask the user to enter the date using 'parameters' (I'd give it to you, but am running out of time :thumbsup:

Don't use quotes.
Date functions can be tricky, but if you double click the entries, Access helps with syntax.
You can combine (AND) one criterion with another by writing them one above another.
And if I recall, OR needs to go across, so may have to pull the field names twice.

See Help for 'parameters' and 'selection criteria' and examples Access offers.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users