Lets Think About Dates?

  • Thread starter Thread starter NeonSky via AccessMonster.com
  • Start date 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!
 
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!
 
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!
 
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]
 
Back
Top