我在SQL Server中有一个表,其中包含用于不同作业的用户的持续时间.我需要计算用户的总体验数.
Declare @temp table(Id int, FromDate DATETIME, ToDate DATETIME)
INSERT INTO @temp ( Id ,FromDate ,ToDate )
VALUES ( 1 , '2003-1-08 06:55:56' , '2005-5-08 06:55:56'),
( 2 , '2000-10-08 06:55:56' , '2008-7-08 06:55:56'),
( 3 , '2013-6-08 06:55:56' , '2015-1-08 06:55:56'),
( 4 , '2006-4-08 06:55:56' , '2011-3-08 06:55:56' )
SELECT * FROM @temp
Run Code Online (Sandbox Code Playgroud)
我想计算经验总数;
Id FromDate ToDate Difference IN Months
===================================================
1 2003-01-08 2005-05-08 28
2 2000-10-08 2008-07-08 93
3 2013-06-08 2015-01-08 19
4 2006-04-08 2011-03-08 59 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ObservableMedia。应用程序编译成功,但是在浏览器控制台中我看到此错误
错误错误:没有ObservableMedia提供程序!在injectionError(core.es5.js:1169)处在noProviderError(core.es5.js:1207)
这是我的代码
import { Component , OnInit, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Rx';
import {MediaChange, ObservableMedia} from "@angular/flex-layout";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent implements OnInit {
constructor(
public media: ObservableMedia) {
}
routeLinkClick() {
if (!this.media.isActive('gt-xs')) {
this.sidenav.toggle();
}
}
Run Code Online (Sandbox Code Playgroud)
请帮忙。谢谢