how to change the active status column in this table?

  • CREATE TABLE [dbo].[tblTable1](

    [syst] [int] IDENTITY(1,1) NOT NULL,

    [duedatefrom] [datetime] NULL,

    [todate] [datetime] NULL,

    [active status] [bit] NULL,

    PRIMARY KEY CLUSTERED

    (

    [syst] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    syst duedatefrom todate active status

    1 2012-04-18 13:20:59.920 2012-04-20 13:20:59.920 1

    store proc to view current date ToDate only

    select

    [syst]

    from

    [tblTable1]

    where

    s.ActiveStatus =1

    AND

    CAST(sb.ToDate AS DATE) >= CAST(GETDATE() AS DATE)

    for example

    in this table duedatefrom , todate has a difference only 2 days

    after completion of the 2 days i have to

    update the active status as active status=0

    in the same view store proc it self

  • Try something like this:

    update [tblTable1]

    set [active status] = 0

    where GETDATE() > [todate]

    Hope this helps.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply