IF DATEPART('weekday', [Fecha del pedido]) = 1
THEN DATEADD('day', 1, [Fecha del pedido])
ELSEIF DATEPART('weekday', [Fecha del pedido]) = 7
THEN DATEADD('day', 2, [Fecha del pedido])
ELSE [Fecha del pedido]
ENDIF DATEPART('weekday', [Fecha de envío]) = 1
THEN DATEADD('day', -2, [Fecha de envío])
ELSEIF DATEPART('weekday', [Fecha de envío]) = 7
THEN DATEADD('day', -1, [Fecha de envío])
ELSE [Fecha de envío]
ENDMIN(
DATEDIFF('day', [Fecha del pedido (movido a un día laborable)], [Fecha de envío (movido a un día laborable)])
+ 1
- 2 * DATEDIFF('week', [Fecha del pedido (movido a un día laborable)], [Fecha de envío (movido a un día laborable)])
)DATEADD('day', -1, DATEADD('month', 1, DATETRUNC('month', [Order Date])))En este ejemplo se usa el conjunto de datos de muestra Superstore para encontrar el número de días laborables entre la fecha del pedido y la fecha de envío de cada pedido.
MIN(
DATEDIFF('day', [Fecha del pedido (movido a un día laborable)], [Fecha de envío (movido a un día laborable)])
+ 1
- 2 * DATEDIFF('week', [Fecha del pedido (movido a un día laborable)], [Fecha de envío (movido a un día laborable)])
) - COUNTD([Fecha de vacaciones])001458004
1658 KB

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.