Results 1 to 2 of 2

Thread: Oh My I cannot figure this out, HELP!

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    32

    Cool

    Can anyone tell me why this would not work?
    IntervalType = "Shift"

    CREATE Procedure UpdateScheduleInterval
    @IntervalType char (5),
    @IntervalName varchar (20),
    @StartTime datetime,
    @EndTime datetime

    AS
    DECLARE @RetCode int
    DECLARE @_error int
    DECLARE @_rowcount int
    Declare @ErrorMsg char (50)
    Declare @BeginTime datetime
    Declare @ExpireTime datetime
    Declare @BeginInt int
    Declare @ExpireInt int
    Select @BeginTime = @StartTime
    Select @ExpireTime = @EndTime
    Select @BeginInt = datepart(mi, @BeginTime) + datepart(hh, @Begintime) * 60
    Select @ExpireInt = datepart(mi, @ExpireTime) + datepart(hh, @ExpireTime) * 60


    SELECT @errorMsg = 'UpdateScheduleInterval could not Update ' + @IntervalType
    SELECT @RetCode = 0
    BEGIN TRAN

    If @IntervalType = "Shift"
    Begin
    UPDATE ScheduleDefine
    SET
    ShiftInterval = @IntervalName
    where (datepart(mi, starttime)+ datepart(hh, starttime) * 60) >= @beginInt and (datepart(mi, starttime)+ datepart(hh, starttime) * 60) <= @Expireint
    end

  2. #2

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    32

    Figured it out.

    This was just a snippet of the code...problem was how @_RowCount was set.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width