Same Date differant year

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Hope someone can help me out or point me to an article that can. What I’m
trying to do is used “Like†to find all records in my table’s “gmDate†column
that have the same date but not the same year. The table has dates going back
about 25 years. The column format is “Short Dateâ€.
Thanks,
Bill
 
Copy and paste the following in a new query in SQL view.

PARAMETERS [Enter the day of the month] Short,
[Enter the number of the month] Short;
SELECT ASIF.*
FROM ASIF
WHERE DatePart("d",[gmDate])=[Enter the day of the month]
AND DatePart("m",[gmDate])=[Enter the number of the month];

Change ASIF to the name of the table.

The above will prompt for the day number first. Next it will ask for the the
number of the month. You need to put in 3 for March.
 
Hi Bill

I don't think you want to use the "Like" function

Try something like:
DaysIWantInfoOn: Month(GmDate) & "/" & Day(GmDate) ="12/15"

That will hand back all the records dated the 15th of December regardless of
year.

Regards

Kevin
 
Jerry
Thanks alot works great. Now to study it to see how I can further use it.
Again thanks,
Bill

Jerry Whittle said:
Copy and paste the following in a new query in SQL view.

PARAMETERS [Enter the day of the month] Short,
[Enter the number of the month] Short;
SELECT ASIF.*
FROM ASIF
WHERE DatePart("d",[gmDate])=[Enter the day of the month]
AND DatePart("m",[gmDate])=[Enter the number of the month];

Change ASIF to the name of the table.

The above will prompt for the day number first. Next it will ask for the the
number of the month. You need to put in 3 for March.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Bill said:
Hope someone can help me out or point me to an article that can. What I’m
trying to do is used “Like†to find all records in my table’s “gmDate†column
that have the same date but not the same year. The table has dates going back
about 25 years. The column format is “Short Dateâ€.
Thanks,
Bill
 
Kevin,
Thanks for the input. I am not quite sure where I should enter your
function in my query. Maybe you can explain. I am been a bit off my game
lately and seem to be missing something.
Thanks,
Bill
 
Back
Top