简体   繁体   English

尝试使用CDate时,我在MS Access查询中收到一条错误消息,指出“溢出”

[英]I am getting an error saying “Overflow” in MS Access query when I try to use CDate

SELECT DISTINCT IWTUSER_ALARMS.NAME, IWTUSER_ALARMS.AID, IWTUSER_ALARMS.DUR, 
   Int(CInt([DUR])/86400) AS DAYS, Int((CInt([DUR]) Mod 86400)/3600) AS HOURS, 
   Int(((CInt([DUR]) Mod 86400) Mod 3600)/360) AS MINUTES, 
   Int((((CInt([DUR]) Mod 86400) Mod 3600) Mod 360)/60) AS SECONDS
FROM IWTUSER_ALARMS
   WHERE (((CDate(Format([IWTUSER_ALARMS].[ITIME],"0000-00-00 00\:00\:00 ")))>=Date()-10))
GROUP BY IWTUSER_ALARMS.NAME, IWTUSER_ALARMS.AID, IWTUSER_ALARMS.DUR, 
   CInt([DUR])/86400, CInt([DUR]) Mod 86400, (CInt([DUR]) Mod 86400) Mod 3600, 
   ((CInt([DUR]) Mod 86400) Mod 3600) Mod 360
ORDER BY IWTUSER_ALARMS.DUR DESC;

After so many trial and error and gathering several information from different sources I was able to solve this problem - Here is the working code below. 经过如此多次的尝试和错误,并从不同的来源收集了一些信息,我得以解决此问题-这是下面的工作代码。

SELECT T.ID, T.NAME, ACOUNT AS AlarmCOUNT

FROM ( 来自(

SELECT DISTINCT(IWTUSER_ALARMS.NAME) AS NAME, COUNT(IWTUSER_ALARMS.NAME) AS ACOUNT, IWTUSER_ALARMS.AID AS ID 选择DISTINCT(IWTUSER_ALARMS.NAME)作为名称,COUNT(IWTUSER_ALARMS.NAME)作为帐户,IWTUSER_ALARMS.AID作为ID

FROM IWTUSER_ALARMS

WHERE (((CDate(Format([IWTUSER_ALARMS].[ITIME],"0000-00-00 00\:00\:00 ")))>=Date()-1))

GROUP BY IWTUSER_ALARMS.NAME, IWTUSER_ALARMS.AID GROUP BY IWTUSER_ALARMS.NAME,IWTUSER_ALARMS.AID

) AS T ORDER BY T.NAME DESC; )按照T.NAME DESC的命令;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么运行MS Access查询时会出现“输入参数值”? - Why am I getting “Enter Parameter Value” when running my MS Access query? 在MS Access中,我从表查询中得到意外结果 - In MS Access, I am getting unexpected result from a query of tables 为什么在运行 MS Access 查询时会收到“输入参数值”? - Why am I getting “Enter Parameter Value” when running my MS Access query? 我无法在 ms access 的嵌套查询中使用 group by - I am unable to use group by in nested query of ms access 尝试运行数组的字符串所需的SQL SELECT查询时,在MS Access中出现运行时错误3141 - Getting Runtime Error 3141 in MS Access when try and run SQL SELECT query needed for a string for an array 我收到访问查询错误:“from 子句中的语法错误” - I am getting an access query error : "syntax error in from clause" 当我尝试使用 union 时出现错误 - I'm getting an error when I try to use union 我收到一个错误,说我的访问查询中的表达式太复杂了 - I am getting an error that the expression in my Access Query is too complex 为什么我无法从此SQL查询中获得任何结果(MS Access) - Why am I not getting any results from this SQL query (MS Access) 为什么在运行查询时出现错误-4700(尝试使用新功能模式)? - Why am I getting error -4700 (attempt to use new function mode) when running a query?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM