... NULL).
-- PROBLEM:
-- assuming date could be blank (has spaces) or in format DDMMYYYY
(TRIM(Date) == "") ? (DT_DBTIMESTAMP)GETDATE() : (DT_DBTIMESTAMP)(SUBSTRING(Date,5,4) + "-" + SUBSTRING(Date,3,2) ...
... DATENAME(dd, getdate())
Weekday Number DAYOFWEEK(now()) DATEPART(dw, getdate())
Month Name MONTHNAME(now()) DATENAME(mm, getdate())
Month Number MONTH(now()) DATEPART(mm, getdate())
European Date ...
... -- SET YEAR RANGE (1912 - 1994: for Birthdate specifically: Older than 18 but younger than 100)
SET @MinYear = DATEPART(YEAR,GETDATE())-100; -- 100 years ...
What?
We have a specific timetabling system for academic institutions and all our staff/students follow academic week numbers as opposed to calendar week numbers.
Why?
The aim of this article ...
... -- SET YEAR RANGE (1912 - 1994: for Birthdate specifically: Older than 18 but younger than 100)
SET @MinYear = DATEPART(YEAR,GETDATE())-100; -- 100 years ...
... AS 'Site',
wm.[WeekNumber] AS FacilityWeek,
CONVERT(CHAR(10), GETDATE(), 103) AS 'WeekStart',
CONVERT(CHAR(10), DATEADD(day, 6, GETDATE()), 103) AS 'WeekEnd',
SD.[SetId] AS 'Set'
FRO ...
... @StartDate DATETIME, @EndDate DATETIME
--First day of current month
SET @StartDate = DATEADD(s,0,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
--First day to display on calendar
SET @StartDate = DATEADD(DAY,-DATEPART(WEEKDAY,@StartDate)+1,@StartDate)
--Last ...
We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies. Read more about our Privacy Policy.