简体   繁体   中英

MS access query error :Syntax error(missing operator)

I am trying to run a query on MS Access I am a newbie in it. I have to find difference of two dates then find count of those who have diff > 10.I am using the datediff

Function for the same

SELECT  count(Admission No.)
From Admissions
where DATEDIFF(DAY, Admission Date, Discharge Date) >10

Where i am going wronmg i am getting a syntax error

Try to encapsulate fields name in square brackets

SELECT  count([Admission No.])
 From Admissions
 where DATEDIFF(DAY, [Admission Date], [Discharge Date]) >10

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM