A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

date restrictor questions



 
 
Thread Tools Display Modes
  #1  
Old May 11th, 2009, 07:24 PM posted to microsoft.public.access
Chuck W[_2_]
external usenet poster
 
Posts: 98
Default date restrictor questions

Hello,
I have a date field called DR. I need to capture all date that are between
two and eight months old starting at the first day eight months ago and
ending with the last day of the month two months ago. So if I were to run it
today, it would be all transactions between 9/1/08 and 3/31/09. If I were to
run it in June, it would be between 10/1/08 and 4/30/09. Can someone help?

Thanks,

  #2  
Old May 11th, 2009, 07:53 PM posted to microsoft.public.access
Beetle
external usenet poster
 
Posts: 1,254
Default date restrictor questions

Use the DateSerial function.

This;

DateSerial(Year(Date()), Month(Date())-8, 1)

will return the first day of the month that is 8 months prior
to the current month.

This;

DateSerial(Year(Date()), Month(Date())-1, 0)

will return the day prior to the first day of last month (i.e. the last
day of the month before that)

--
_________

Sean Bailey


"Chuck W" wrote:

Hello,
I have a date field called DR. I need to capture all date that are between
two and eight months old starting at the first day eight months ago and
ending with the last day of the month two months ago. So if I were to run it
today, it would be all transactions between 9/1/08 and 3/31/09. If I were to
run it in June, it would be between 10/1/08 and 4/30/09. Can someone help?

Thanks,

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.