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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date Restrictor for this month



 
 
Thread Tools Display Modes
  #1  
Old June 16th, 2004, 02:08 PM
Haji
external usenet poster
 
Posts: n/a
Default Date Restrictor for this month

Hi,

How do I do a date restrictor that gives me month to date
numbers (June 1 to June 16th) . Also, How do I get a
date restrictor for last june month to date (6/1/03 to
6/16/03) on a going forward basis. I will eventually
create a month to date sales report of our customers that
also shows what their month to date sales were last year
at this time. This will be part of an application that
will be used continuously over the next year or so.

Thanks,

Haji
  #2  
Old June 16th, 2004, 03:54 PM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default Date Restrictor for this month

Do you mean criteria for you Select Query?

If so, for the current month to date:

BETWEEN DateSerial(Year(Date()), Month(Date()), 1)
AND Date()

and for the corresponding period last year:

BETWEEN DateSerial(Year(Date()) - 1, Month(Date()), 1)
AND DateSerial(Year(Date()) - 1, Month(Date()), Day(Date()))

You will have to think about corresponding periods for leap year and
non-leap year!

--
HTH
Van T. Dinh
MVP (Access)


"Haji" wrote in message
...
Hi,

How do I do a date restrictor that gives me month to date
numbers (June 1 to June 16th) . Also, How do I get a
date restrictor for last june month to date (6/1/03 to
6/16/03) on a going forward basis. I will eventually
create a month to date sales report of our customers that
also shows what their month to date sales were last year
at this time. This will be part of an application that
will be used continuously over the next year or so.

Thanks,

Haji



 




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 07:07 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.