Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246
Home / T-SQL / Dichtstbijzijnde werkdag uitrekenen

Dichtstbijzijnde werkdag uitrekenen


Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246

Check Also

Calculate Age in SQL Server


Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 76

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/kraije21/domains/sqlblog.nl/public_html/wp-content/plugins/seo-auto-links/seo-auto-links.php on line 246

One comment

  1. Ronald Kraijesteijn

    SELECT *
    FROM
    (SELECT DD.DatumId, DD.DatumWaarde, BD.DatumID AS BoekDatumID
    ,ROW_NUMBER() OVER(PARTITION BY DD.DatumId
    ORDER BY
    (CASE WHEN DD.WeekNummer = BD.WeekNummer THEN 0 ELSE 1 END) ASC,
    ABS(DATEDIFF(dd,DD.DatumWaarde, BD.DatumWaarde)) ASC,
    BD.DagNummerVanWeek ASC
    ) AS RowID
    FROM dbo.DimDatum AS DD
    — BD: Boek Datum
    INNER JOIN dbo.DimDatum AS BD
    ON DD.Jaar = BD.Jaar
    AND DD.MaandNummerVanJaar = BD.MaandNummerVanJaar
    WHERE ABS(DATEDIFF(dd,DD.DatumWaarde, BD.DatumWaarde))<=10 AND (DD.IsWerkDag=0 OR DD.IsFeestDag_NL=1) AND BD.IsWerkDag=1 AND BD.IsFeestDag_NL=0 ) AS X WHERE X.RowID=1

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *