Results 1 to 5 of 5
  1. #1
    Join Date
    May 2008
    Posts
    35

    Unanswered: Get All Records from timestamp

    I need to retreive all records for todays date something like this

    select *
    from TABLEa
    where A = ??


    So A should match all data for todays date and ignore all time data

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    What do you know about date/time/timestamp calculations on DB2?

    Did you read this article?
    DB2 Basics: Fun with Dates and Times

    What did you tried? What result(or error) did you got from the trial?

  3. #3
    Join Date
    May 2008
    Posts
    35
    I'm totally from sybase dont know much on db2
    I tried this and it works
    where DATE(COLUMNA) = DATE('2009-11-28')

    also for current date

    where DATE(COLUMNA) = DATE(current date)

    but how do i get a previous date record say something like this

    DATE(current date) - 1

  4. #4
    Join Date
    Dec 2005
    Posts
    273
    Try:

    current date - 1 DAY



    there is no need to use DATE() with current date

  5. #5
    Join Date
    May 2008
    Posts
    35
    Yeah this worked.Still learning DB2 ;-)

Posting Permissions

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