Main ideas:
For any 2 dates, such as: Date_start=2006-10-1, date_end=2006-10-14, first calculate the interval between the dates (days), and then get their next Monday date for Date_start and Date_end respectively. So you can get a new full date interval that divides 7 (this new date interval has removed the week's question), in other words, we can get the number of weeks between these two new dates, and multiply this week by 5, which is the
Copy Code code as follows:
if exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ F_workday] and Xtype in (n ' FN ', n ' IF ', n ' TF '))
Drop function [dbo]. [F_workday]
Go
--Calculates the number of working days that differ by two dates
CREATE FUNCTION F_workday (
@dt_begin datetime,--the calculated start date
@dt_end datetime--The calculated end date
) RETURNS int
As
BEG
If can be directly in the form of easy to calculate, so the personnel in the Personnel department to get a lot of help, in the end is how to achieve, below a look at it.
Specific steps to operate:
1, open a need to calculate the working day of the table, we in the D2 cell input formula: =networkdays (B2,C2).
2, enter the results of 21, in January 2010, out of Saturday and Sunday, the working day h
The SQL statement is used to calculate the number of working days between two dates.
/*Due to a strange demand at work, the SQL language is used to calculate the number of working days between two days.It is set to have 5 working days
SQL calculates the number of days working between two dates http://blog.163.com/im_foto/blog/static/49085060200953010553914/ -- calculates the number of days working between two dates
Create Function f_workdatediff (
@ Dt_begin datetime,
@ Dt_end datetime)
Returns int
As
Begin
Declare @ workday int, @ I int, @ BZ bit,
Oracle stored procedure returns (N) working days based on the specified date
I have never written any Oracle stored procedures. Today I have a sudden demand: Calculate the first N working days of the specified date or the next N working
I recently encountered a problem that requires the number of working days between two dates. I found the js Code on the Internet and referred to other people's code. I found that all the code was redundant. So I thought about it myself, after a simple process. It is mainly simplified in loop processing.
The cycle of the remaining days can also be considered as pr
The instance is as follows:
//start date, /pattern/is the definition of regular expression, pattern is the content to match, only for the first symbol match, G is the global match flag var begindate = new Date ("2013-01-01". Replace (/-/g, "/"));
End date var enddate = new Date ("2013-01-31". Replace (/-/g, "/"));
The date difference value, which contains the days of the week 6th, 86400000=1000*60*60*24.
var workdayval = (enddate-begi
(minute,bu_trupstartdate,bu_trupenddate) *1./60 as DECIMAL (18,1)) from View_apply_ Bu_tripreport WHERE [email protected]ENDIF (@startTimeH BEGINSELECT @sResultHour = (DATEDIFF (hour,bu_trupstartdate,bu_trupenddate))-1 from View_apply_bu_tripreport WHERE [email ProtectedENDIF (@startTimeH >=12)BEGINSELECT @sResultHour =cast (DATEDIFF (minute,bu_trupstartdate,bu_trupenddate) *1./60 as DECIMAL (18,1)) from View_apply_ Bu_tripreport WHERE [email protected]ENDENDIF (@Day >=1)BEGINIF (@startTimeH BE
-based, Android supplemented,Side to make something, since to do something, smattering how to do, even through a variety of search Baidu Google to make things,So what can be done, and now suddenly feel a little bit faint. Read the Java video to read, read the Java book to seeAndroid videos, after watching Android videos and then looking at Android books, such a learning process is not only a long cycle, the process is difficult,I'm still taking myself to Android, and my colleague told me there's
Before the network query about the use of SQL query "date after a few days" question, the effect is, assuming today is Wednesday (2014/08/27), after three business days (including Wednesday) is Friday (20140929), four business days later, It is next Monday (20140901), if the legal holidays, when the weekend processing (such as Monday is the mid-Autumn Festival, M
MSSQL calculates the code for two working days with different dates. For more information, see.
MSSQL calculates the code for two working days with different dates. For more information, see.
The code is as follows:
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [f_WorkDay] ') and xtype in (n
Warning Message in Work Center: "factory calender and shift model have different working days ". Two solutions for this warning message: 1: remove the factory calendar ID from available capacity of Work Center and need to re-set the intervals of available capacity and provide Validity Period 2: HasOverride the factory calender you have to set the field 'work days
Count the number of working days between the current date and the end of the month. If you have a requirement on the Operation side today, you need to find out the registration users who want to exclude the daily logging on Saturday and Sunday (including not the day of Saturday ), at that time, the first response was to find a function that could exclude the number of w
If exists (select * from dbo. sysobjects where id = object_id (n' [tb_Holiday] ') and OBJECTPROPERTY (id, n'isusertable') = 1)
Drop table [tb_Holiday]
GO
-- Define holiday tableCreate table tb_Holiday (HDate smalldatetime primary key clustered, -- holiday periodName nvarchar (50) not null) -- holiday NameGO
If exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [f_WorkDay] ') and xtype in (n'fn', n'if', n'tf '))Drop function [dbo]. [f_WorkDay]GO
-- Calculate the number of
There is now a report that calculates the number of days a user is working continuously, and finds that the problem can be calculated perfectly by using the Row_number analysis function.This SQL can solve the problem of computing users ' continuous landing, sign-in, work, absenteeism and so on.
First, sort the row_number by date.
The day of the date, such as 2016-7-1, is truncated to 1 and conv
Copy codeThe Code is as follows: if exists (select * from dbo. sysobjects where id = object_id (n' [dbo]. [f_WorkDay] ') and xtype in (n'fn', n'if', n'tf '))
Drop function [dbo]. [f_WorkDay]
GO
-- Calculate the working days of two different dates
Create function f_WorkDay (
@ Dt_begin datetime, -- Calculation start date
@ Dt_end datetime -- end date of Calculation
) RETURNS int
AS
BEGIN
Declare @ I int
Sele
After two days, I still couldn't solve the problem. I had to ask everyone for help with the imagick extension. thanks, I actually wanted to use imagick and didn't want to use the gd library that comes with php to process images. Previously I used php5.2, imagick can also be used normally, the dll file used is php_imagick_st-Q8.dll recently updated php to php5.3.20, the previous version of imagick can no longer be used, a variety of google, I have been
Come to singapore one months, graduation also has 1.5, look back to graduate out of work 1.5, compared to now working in Singapore Day, feeling a lot. Because I belong to too many setbacks, psychological pressure can also, the thick skin of the kind, so this new job is quite suitable, although the pressure is very large, oh, the basic in Singapore every night after 00:00 to rest.
The first year to do a communication of foreign enterprises, a year of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.