I have a table that has more than one date fields (say six or seven) and I just want to retrieve only the dates that match today's date. Please help. Really appreciate it thanks
1 Answer
This is a very specific problem, so the best way to get the result you want is to code some part as an script on access.
For getting those rows where at least one date is the same as today's date, you should use something like this.
SELECT * FROM Table t
WHERE Date() IN (t.field1, t.field2, ...)
You should add all the fields you want to check inside IN clause.
On the Access for you should be able to process the data.
4 Comments
antony samid
Great!! Harsha I'll check and let you know in case of any questions. Thanks a lot
antony samid
Hi there, I tried the following code (SELECT * FROM Table t WHERE Date() IN (t.field1, t.field2, ...) but it pulls all the dates which is not exactly expected. Your thoughts please
antony samid
actually what i need is that the result from the query should serve as a report and that report should show the project id and project title (the first two columns) along with only the dates that equal today's date. not all date fields are required in this result. the bottom line is that this result should act as Todo list for today. i guess i am clear about what i intend to get. Thanks
JCalcines
You should update your question with this new information
GetDate()in Access? can you not go withwhere yourdatefield = DATE() OR yourotherdatefield = DATE()..... or if you want all the fields to = todays date useANDinstead ofOR(DATE()gives you todays date)