Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to divide a year up.

Status
Not open for further replies.

aexley

Technical User
Jul 9, 2001
147
GB
I need to divide the year up into 12 periods to determine the 'period number'. I'm considering using the code below: -

If Date >= DateValue(&quot;30/04/&quot; & Year(Now)) And Date <= DateValue(&quot;27/05/&quot; & Year(Now)) Then
Me!Period = 2
Exit Sub
End If

Unfortunately this means that I have to repeat this statement 12 times with the appropriate values for each period in. This seems rather unwieldy, could anyone suggest a better way?

Many thanks in advance.


Quote for the day : &quot;The people walking around with a smile on their face today - bought the right Valentines present yesterday.&quot;
 
DatePart or Month or Select Case Or ...

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thanks MichaelRed but I need both to check against both the day and month because it's not a straight month to month period length (some accounting periods are five weeks long. As far as I can tell with Access Help, DatePart and Month only deal with one part of the date at a time and I wouldn't know where to begin with 'Select Case'.

Thanks anyway,

aexley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top