Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Unanswered: getting prevoius day's date in a query?

    could anybody help me in getting the previous day's date in a query:
    In sql analyzer, the query "select getdate()-1" returns the previous day's date!
    do we have a db2 equivalent of the above mentioned query.

  2. #2
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    values (current date - 1 day)
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Or "select current_date - 1 day from sysibm.sysdummy1"
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    interesting. There are two choses current date or current_date. I recommend using current_date because it is a standard SQL.
    Hope this helps,
    Grofaty

Posting Permissions

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