Have a date field with data type as "text", the data is in MM/YYYY format. having trouble querying by date range. Any sugestions?. I'm not allowed to change the date type in table. Help is appreciated.
did that, I'm still getting the the year portion wrong. seems like it is only looking at the month portion of the data.................. thanks for your response.
Try formatting the date field you are searching for and the date criteria in the where clause. I also have the same annoying problem at one of my jobs (dates in text format). One thing I've found very helpful is to format the dates with the year first, then month, then day. This makes sorting the data chronologically possible.
Try pasting this into the SQL view of a query and tweak it to meet your needs...
SELECT Format([DateField],"yyyy/mm" AS Expr1
WHERE (((Format([DateField],"yyyy/mm")>Format([Enter Start Date],"yyyy/mm" And (Format([DateField],"yyyy/mm")<Format([Enter End Date],"yyyy/mm");
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.