Avatar of binaryman101
Flag for United States of America

asked on 

Filtering for todays date with multiple dates in one field

I have SQL 2005.  I thought I had done this before, however, I am realizing I have not.  I have a table called MaintenanceTasks with the following fields:  dayofyear, subject, task.

Inside of this table are some examples:

dayofyear          Subject               Task

7/5, 7/6, 7/7       Take trash          Remove trash from building
7/6, 8/15, 10/1    Wash windows  Wash all windows inside and out

I am wishing to write a query that will pull anything with today's date (today is 7/5) and display just that record.  

So in this example since today is 7/5 I would like to pull just this record even though it has two other dates in it (because this task needs done on multiple dates):
7/5, 7/6, 7/7       Take trash          Remove trash from building

I hope I explained this well enough.  Let me know.

Thank you
Microsoft SQL Server 2005

Avatar of undefined
Last Comment

8/22/2022 - Mon