SQL Server的Datediff和Access的Datediff的区别
2007-10-23 21:51
246 查看
SQL Server的Datediff和Access的Datediff的区别
google_ad_client = "pub-2048279401139630";google_ad_slot = "8856771542";google_ad_width = 728;google_ad_height = 90;document.write("");
What function does: returns a variant to reflect the time difference between two dates
Syntax: DateDiff( inteval, firstdate, seconddate [,firstweekday[ [ , firstweek])
Example
The following shods the difference in days between two dates:
= DateDiff("d", "11-05-2002", "11-07-2002") returns 2
The following table lists the valid time periods and their interval values.
Time Interval Syntax
Year
yyyy
Quarter
q
Month
m
Day of year
y
Day
d
Weekday
w
Week
ww
Hour
h
Minute
n
Second
s
Note: Take special care for "ww" vs "w." "WW" is for a week.
AgeYrs: DateDiff("d",[INSERVICE],Now())/365
Gives me this result:
14.5972602739726
in SQL the function:
AgeYrs = DATEDIFF(d,INSERVICE,getdate())/365
其实就是"需要注意!
google_ad_client = "pub-2048279401139630";google_ad_slot = "8856771542";google_ad_width = 728;google_ad_height = 90;document.write("");
What function does: returns a variant to reflect the time difference between two dates
Syntax: DateDiff( inteval, firstdate, seconddate [,firstweekday[ [ , firstweek])
Example
The following shods the difference in days between two dates:
= DateDiff("d", "11-05-2002", "11-07-2002") returns 2
The following table lists the valid time periods and their interval values.
Time Interval Syntax
Year
yyyy
Quarter
q
Month
m
Day of year
y
Day
d
Weekday
w
Week
ww
Hour
h
Minute
n
Second
s
Note: Take special care for "ww" vs "w." "WW" is for a week.
AgeYrs: DateDiff("d",[INSERVICE],Now())/365
Gives me this result:
14.5972602739726
in SQL the function:
AgeYrs = DATEDIFF(d,INSERVICE,getdate())/365
其实就是"需要注意!
相关文章推荐
- VC+ADO 连接ACCESS和SQL SERVER的区别
- ACCESS中使用SQL语句应注意的地方、与sql server的区别及几点技巧(整理中)
- Access与SQL Server的一点区别
- Access和SQL Server的语法区别
- sql server和access 中sql语句的区别(佚名)
- sql server语句和access语句删除区别
- Access 与 SQl server 一些写法上的区别 记录
- DateDiff 在ACCESS与SQL中的区别
- Round函数在SQL Server与Access中的区别
- Access和sql server的语法区别
- Oracle、SQL Server、Access的区别
- MySQL、SQL Server 、 Oracle、Access的sql语句区别
- SQL Server和Access设置自增字段的区别
- DateDiff函数在Sql与Access中的区别【转】
- Access和sql server的语法区别
- Like 和日期类型在ACCESS和SQL Server的区别
- Access和sql server的语法区别
- DateDiff在Access与Sql server中的差别
- Access和sql server的语法区别 (包括db2 oracle)
- Access, SQL Server, Oracle, MySQL的区别与相似