Home > Database > Mysql Tutorial > SqlServer中插入无时间的日期

SqlServer中插入无时间的日期

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:51:21
Original
1457 people have browsed it

很简单你可以用: SELECT DATEADD(dd, DATEDIFF(dd, '2000-01-01 00:00:00' , GETDATE() ), '2000-01-01 00:00:00' ); 这样也可以: SELECT DATEADD( DAY ,DATEDIFF( DAY ,0,GETDATE()),0) 结果是: 2009-11-15 00:00:00.000(这是今天的日期) Author:Petter

很简单你可以用:

<span>SELECT</span> DATEADD(dd, DATEDIFF(dd, <span>'2000-01-01 00:00:00'</span>, GETDATE() ), <span>'2000-01-01 00:00:00'</span> );
Copy after login

这样也可以:

<span>SELECT</span> DATEADD(<span>DAY</span>,DATEDIFF(<span>DAY</span>,0,GETDATE()),0)
Copy after login

结果是:

2009-11-15 00:00:00.000(这是今天的日期)

Author:Petter Liu  http://wintersun.cnblogs.com

希望对您有帮助!

Related labels:
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
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template