Display picture dependant on date, regardless of year

Icehousman2

Registered User.
Local time
Today, 07:22
Joined
May 12, 2004
Messages
45
I have a report that needs to show a different picture with each seasonal change. One for summer, Spring, etc. Right now I have an IF then statement set up that tests the current date against predefined dates for the Seasonal changes.

If Date < #9/21/2004# then
blah blah

However, I want this function to work over a matter of years, and as you can see if the current date moves into 2005 then this code will no longer work. Is there a way to disregard the year, in these functions? Thank for the help in advance.
 
Try just referencing the month using either the Format function or the DatePart function. Check out their usage in Access Help.
 
Thanks for the response, but I have already looked in access help and couldn't find a solution to this problem. Any more suggestions anyone?
 
You looked at the DatePart function?

Code:
Select Case [b]DatePart[/b]("m", Date)
    Case 11 To 2: MsgBox "It's Winter"
    Case 3 To 5: MsgBox "It's Spring"
    Case 6 To 8: MsgBox "It's Summer"
    Case 9,10: MsgBox "It's Fall"
End Select

Again, look in Access Help for it's usage.
 
Thanks, I was hoping to use both the day and the month to get this as accurate as possible, but I'm having a hell of a time getting that to work, so maybe i will just use the month. Thanks for the help.
 
Then use the Format function:

Format(Date, "MMDD")
 
How would you do a conditional test with this type of format? Can you give me an example? And i'm in Seattle. Not that it matters, but I just noticed you are from Portland.
 

Users who are viewing this thread

Back
Top Bottom