Extracting 2 year history of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to extract a 2 year history of data based on a date in my
query. I have tried using the following syntax but it returns data prior to
2 years:
DatePart("yyyy",[FundedDate]-1)

Now, I can use the criteria of > "1/1/2004" but this requires annual
maintenance. Any ideas?
 
Use datediff to subtract 2 years from the current date and use that in your
"greater than" statement in the criteria.



Ken D. said:
I am attempting to extract a 2 year history of data based on a date in my
query. I have tried using the following syntax but it returns data prior to
2 years:
DatePart("yyyy",[FundedDate]-1)

Now, I can use the criteria of > "1/1/2004" but this requires annual
maintenance. Any ideas?
 
Oops - That won't work.

I'm trying a few ideas. Ignore previous post.



Ken D. said:
I am attempting to extract a 2 year history of data based on a date in my
query. I have tried using the following syntax but it returns data prior to
2 years:
DatePart("yyyy",[FundedDate]-1)

Now, I can use the criteria of > "1/1/2004" but this requires annual
maintenance. Any ideas?
 
Ok.

Try...
DateSerial(Year(Date())-2,Month(Date()),Day(Date()))



Hope that helps.


Rick B


Ken D. said:
I am attempting to extract a 2 year history of data based on a date in my
query. I have tried using the following syntax but it returns data prior to
2 years:
DatePart("yyyy",[FundedDate]-1)

Now, I can use the criteria of > "1/1/2004" but this requires annual
maintenance. Any ideas?
 
That worked. I tried using Date Serial but did not have the correct syntax.

Thank you Rick

Rick B said:
Ok.

Try...
DateSerial(Year(Date())-2,Month(Date()),Day(Date()))



Hope that helps.


Rick B


Ken D. said:
I am attempting to extract a 2 year history of data based on a date in my
query. I have tried using the following syntax but it returns data prior to
2 years:
DatePart("yyyy",[FundedDate]-1)

Now, I can use the criteria of > "1/1/2004" but this requires annual
maintenance. Any ideas?
 
Back
Top