Forum Replies Created

Viewing 7 posts - 331 through 337 (of 337 total)

  • RE: date calculations

    bitbucket-25253 (11/9/2010)


    Is this what you are seeking:

    SELECT DATEADD(mm,-3,DATEADD(day, 1, GETDATE()))As '3 months ago',GETDATE() AS 'Today',

    DATEADD(day, 1, GETDATE()) AS 'Today plus 1 day'

    Results:

    3 months ago ...

  • RE: date calculations

    Are you using SQL 2008 ?If not then it will error out.

  • RE: date calculations

    select convert(date,dateadd(mm,-3,GETDATE()+1))

  • RE: Help with the Stored Proc

    That wont be much of a problem.any of the above solutions posted will work.

  • RE: Help with the Stored Proc

    select top 1 status from yourtable where status='Failure'

    IF @@rowcount>=1

    select 'Failed'

    else

    select 'Success'

  • RE: Need help with writing TSQL

    declare @t table(id int identity,dt date NULL,stepid int)

    insert @t

    select '2008-03-03',1 union all

    select '2008-03-04',1 union all

    select '2008-03-14',5 union all

    select null,5 union all

    select '2008-03-20',6...

  • RE: ATTACHED SUSPECT DATABASE in SQL2008 R2

    Is the last full backup and log file available.If yes then you need to

    1)Take a Tail log backup.

    2)Create a new database and then restore the full backup.

    3)Restore the Tail log...

Viewing 7 posts - 331 through 337 (of 337 total)