Extract Day and Month from Date ignoring year (1 Viewer)

Zampa

New member
Local time
Today, 23:50
Joined
May 21, 2019
Messages
8
i have a challenge to produce a marketing list for our company based on dates where potential customers contacted us in the past , but did not do business with us. We now want to get back to them with this years offers to see if we can sell this time round.
My challenge comes from the fact that the date i have to work on is " date record created". The date can be anything between 01/01/2010 and this time last year.
As an example the list might look like this
Date Record Created
01/06/2014
02/06/2015
02/06/2017
etc.
How can i create a query that calls back data where the date is between say 1st June and 15th June, regardless of the year the record was created?

Every time i try to add this in a select query, leaving out the year, Access adds 2019 to the date and this returns no records, which is wouldn't as the newest date is in June 2018.
If i put a date range in of 01/06/2010 to 15/06/2018 it does of course pick up every date in that range, including July, August, Sept etc.

I just want all the dates fora range in June regardless of the year the record was created. At the moment i have manually amended the dates in the query but id like to create a little form for the end user to choose their own data ranges going forward.
Thanks in advance for any help
 

jdraw

Super Moderator
Staff member
Local time
Today, 19:50
Joined
Jan 23, 2006
Messages
15,364
Try
Code:
Select * from [COLOR="DarkOrange"][B]YourTableName[/B][/COLOR]
WHERE
Month([Date Record Created]) = 6 And 
Day([Date Record Created]) Between 1 and 15 And
Year([Date Record Created]) Between 2010 and 2018

Replace the YourTableName as appropriate.
 

Zampa

New member
Local time
Today, 23:50
Joined
May 21, 2019
Messages
8
spot on - thanks very much
 

jdraw

Super Moderator
Staff member
Local time
Today, 19:50
Joined
Jan 23, 2006
Messages
15,364
You are very welcome. Happy to help.
 

Users who are viewing this thread

Top Bottom