Need to compare two "complete date" (m/d/yyyy) in a query.I can use the DatePart function to extract a month, or a day or a year, but apparently not all three at the same time. The fields in the query are populated with the Now() function, so I get something like this: 1/22/2004 8:39:07 a.m. What I need to do is compare the full date,i.e 1/22/2004 with another date, like 1/23/2004.
This can be done if you use about six new query fields, the DatePart function half-a-dozen times and then create a function that compares first year to year, then month to month and finally, say, day to day, but this does not seem like a elegant approach.
Is there a better way? And if I can extract the full day, have I failed to anticipate problems with trying to compare a complete date with a compete date? Why is there not a better way in Access to do this? Am I missing something here?
This can be done if you use about six new query fields, the DatePart function half-a-dozen times and then create a function that compares first year to year, then month to month and finally, say, day to day, but this does not seem like a elegant approach.
Is there a better way? And if I can extract the full day, have I failed to anticipate problems with trying to compare a complete date with a compete date? Why is there not a better way in Access to do this? Am I missing something here?