Lets Think About Dates?

  • Thread starter NeonSky via AccessMonster.com
  • Start date
N

NeonSky via AccessMonster.com

Hello All!

Here is my question in my table I have two date fields/columns. For context
sake lets pretened we are dealing with a hotel company, the first field is
titled "TransactionDate", and the second is titled "ArrivalDate". Now I only
want to return records where the transaction date is greater than or equal to
13 months previous to the arrival date. For example.....

TransactionDate ArrivalDate
11/01/2005 01/15/2007
08/02/2006 01/23/2007
01/01/2006 03/01/2007

For the sample record set above I would like to know how to return the first
and third records (being that they are 13 months out from one another).

Happy to clarify!

Thank you in advance for thinking about my question!
 
D

Douglas J. Steele

And quickly, too! <g>

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Klatuu said:
You write very good code, Douglas :)

Douglas J. Steele said:
WHERE DateDiff("m", [TransactionDate], [ArrivalDate]) >= 13

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


NeonSky via AccessMonster.com said:
Hello All!

Here is my question in my table I have two date fields/columns. For
context
sake lets pretened we are dealing with a hotel company, the first field
is
titled "TransactionDate", and the second is titled "ArrivalDate". Now
I
only
want to return records where the transaction date is greater than or
equal
to
13 months previous to the arrival date. For example.....

TransactionDate ArrivalDate
11/01/2005 01/15/2007
08/02/2006 01/23/2007
01/01/2006 03/01/2007

For the sample record set above I would like to know how to return the
first
and third records (being that they are 13 months out from one another).

Happy to clarify!

Thank you in advance for thinking about my question!
 
N

NeonSky via AccessMonster.com

Thank you for your responses!

Though would you please elaborate as to how to structure the insertion of
this statement within the query design window?

Thank you!
WHERE DateDiff("m", [TransactionDate], [ArrivalDate]) > = 13
Hello All!
[quoted text clipped - 15 lines]
Thank you in advance for thinking about my question!
 
N

NeonSky via AccessMonster.com

You know what guys, I got it sorted out. Thanks so much, you all rock!!
Thank you for your responses!

Though would you please elaborate as to how to structure the insertion of
this statement within the query design window?

Thank you!
WHERE DateDiff("m", [TransactionDate], [ArrivalDate]) > = 13
[quoted text clipped - 3 lines]
 

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

Similar Threads

Date Query 2
Excel Jululian 5
Populate a table 2
Dates 4
Excel not recognizing dates as dates 1
Oldest date 2
Lookup Maximum between Range of Dates 2
Building a TickleDate System??? 1

Top