making a database and running date querys

  • Thread starter Thread starter bradhamblen
  • Start date Start date
B

bradhamblen

I need to make a query that will look for empolyee anniversary for the
next 30 days that will sort them into 1 year ,5 years and 10 years.
This has stumped me.

Hambone
 
Hi Hambone,

Here is a starter,

In query make a check date made up as follows: A = Date of Start

dateSerial(Year(Now()),Month([A]),Day([A])

Now your have this years aniversary date.

Criteria = Between Now() and Dateadd("d",30,Now())

This has got all days within the next 30 days

In another field you can have Datediff("y",Now(),[A]) then sort on this
field to get sorted into years order. (Or make criteria = in(1,5,10)

Hope you understand this

Trev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top