Home > Database > Mysql Tutorial > body text

DateDiff在Access与Sql server中的差别

WBOY
Release: 2016-06-07 15:43:15
Original
1615 people have browsed it

语法 DateDiff(interval, date1, date2 [ , firstdayofweek ] [ , firstweekofyear ] ) 差别在于interval是否要用引号; Access:DateDiff('n',lastActiveTime,'" + DateTime.Now + "')=10 Sql server: DateDiff(n,lastActiveTime,'" + DateTime.Now + "')=10

语法

DateDiff(interval, date1, date2 [, firstdayofweek] [, firstweekofyear] )

 

差别在于interval是否要用引号;

Access:DateDiff('n',lastActiveTime,'" + DateTime.Now + "')>=10

Sql server:DateDiff(n,lastActiveTime,'" + DateTime.Now + "')>=10

interval 参数 (参数:为操作、事件、方法、属性、函数或过程提供信息的值。)包含以下设置:

设置 说明
yyyy
q 季度
m
y 某年的某一天
d
w 工作日
ww
h
n
s

 

参数 
Year
yyyy

Quarter
q

Month
m

Day of year
y

Day
d

Weekday
w

Week
ww

Hour
h

Minute
n

Second
s

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!