I would like to use a case statement to determine the day of the week i.e. Sun =1 Mon = 2 etc. The information is being supplied from a SP. The user will type in the day of the week (mon,tue, etc) and I want the SP to determine the numeric value. I have provided my SP.
CREATE Procedure TypicalInsert @AssocNum bigint,@DOW nvarchar(3),@ShiftStart datetime,@ShiftEnd datetime,@LunchO datetime,@LunchI datetime
as
set @lunchI=null
set @lunchO=null
Insert into tblTypical (AssocNum,DOW,ShiftStart,ShiftEnd,LunchO,LunchI)
values (@AssocNum,@DOW,@shiftstart,@ShiftEnd,@LunchO,@LunchI)
GO
I would like to use the variable @DOW to insert the numeric value. Does anyone know how this can be done.
CREATE Procedure TypicalInsert @AssocNum bigint,@DOW nvarchar(3),@ShiftStart datetime,@ShiftEnd datetime,@LunchO datetime,@LunchI datetime
as
set @lunchI=null
set @lunchO=null
Insert into tblTypical (AssocNum,DOW,ShiftStart,ShiftEnd,LunchO,LunchI)
values (@AssocNum,@DOW,@shiftstart,@ShiftEnd,@LunchO,@LunchI)
GO
I would like to use the variable @DOW to insert the numeric value. Does anyone know how this can be done.