I have a problem with my query in MS Access 2000. I need to select by the current date in database. I put either function date() or now and it doesn’t work.
Here is my query:
SELECT TOP 100 PERCENT dbo.КАРНЕТ.НомКарнета, dbo.ФИРМА.НаимПредпр
FROM dbo.ФИРМА INNER JOIN
dbo.КАРНЕТ ON dbo.ФИРМА.КодПредпр = dbo.КАРНЕТ.КодПредпр
WHERE (dbo.КАРНЕТ.ДтСдачи = CONVERT(DATE, 'DATE()', 102))
GROUP BY dbo.КАРНЕТ.НомКарнета, dbo.ФИРМА.НаимПредпр;
You should be able to use
Date()without the single quotes:The
Date()function will return the current system date.If your
dbo.КАРНЕТ.ДтСдачиhas time included in it, then you might need to format that and you can also format theDate()value the same:Note: I just tested the above line in MS Access 2003 and it returned records. The code should be the same for MS Access 2000.