简体   繁体   English

使用TableAdapter C#[sql]计算两次之间的分钟数

[英]Calculating Minutes between two times using TableAdapter C# [sql]

I want to calculate minutes between two times, I am generating method using TableAdapter. 我想计算两次之间的分钟数,我正在使用TableAdapter生成方法。

I am trying with this 我正在尝试这个

SELECT        
   name, signin, 
   DATEDIFF([minute], signin, [DateTime].Now) AS Expr1
FROM            
   Table1

This should calculate minute between the current time and the previous time 这应该计算当前时间和上一个时间之间的分钟

The correct text for this query should be 此查询的正确文本应为

SELECT        
   name, signin, 
   DateDiff('n',signin,Now()) as MinuteDifference
FROM            
   Table1

To represent the difference in minutes to the DateDiff function you use the shortcut 'n' (between single quotes) and do not prefix the Now() function with the DateTime word. 为了表示与DateDiff函数的分钟差,请使用快捷方式“ n”(在单引号之间),并且不要在Now()函数前加上DateTime字词。 This is totally unknown to the Access Engine 这是访问引擎完全未知的

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

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