Results 1 to 4 of 4

Thread: sysdate - 15

  1. #1
    Join Date
    Jul 2011
    Posts
    3

    Unanswered: sysdate - 15

    hi all,

    I would like to know the query to calculate date 15 days before the sysdate.
    i.e. (sysdate-15)

    Thanks for your help in advance.

  2. #2
    Join Date
    May 2011
    Posts
    28

    sysdate -15

    Hi,
    1> select dateadd(dd,-15,getdate())
    2> go

    --------------------------
    Jun 29 2011 11:07PM

    (1 row affected)
    1>

  3. #3
    Join Date
    Jul 2011
    Posts
    3

    sysdate-15

    Hey pradyut,

    Thanks for your help. 2 more things I require..
    1. The way to store the output in the variable
    2. A good source to learn sybase.

    Thanks again.

  4. #4
    Join Date
    May 2011
    Posts
    28
    Hi,
    here you go.
    1> declare @d1 char(8)
    2>
    3> select @d1= convert(char(8),dateadd(dd,-15,getdate()),112)
    4> print "%1!",@d1
    5> go
    (1 row affected)
    201106301>

Posting Permissions

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