Buscando una consulta SQL/consultas que determinarían el día de inicio (lunes) de la semana actual.buscando el día de inicio (lunes) de la semana actual
Ejemplo: Si hoy es -> entonces el comienzo de la semana es
Sat Oct 09, 2010 -> Start of the week is Monday Oct 04, 2010
Sun Oct 10, 2010 -> Start of the week is Monday Oct 04, 2010
Mon Oct 11, 2010 -> Start of the week is Monday Oct 11, 2010
Tue Oct 12, 2010 -> Start of the week is Monday Oct 11, 2010
he visto muchas "soluciones" en Google y StackOverflow. El aspecto algo como:
SET @pInputDate = CONVERT(VARCHAR(10), @pInputDate, 111)
SELECT DATEADD(DD, 1 - DATEPART(DW, @pInputDate), @pInputDate)
Esta falla porque: Dom Oct 10 2010 -> Inicio de semana Lunes Oct 11 del 2010 (lo cual es incorrecto).
¿Necesita encontrar solamente el lunes o el primer día hábil de la semana? –
Quiero el comienzo de la semana (lunes) independientemente de si es un día laboral o festivo. –