Thread

  1. Tiiiiiiiiiiiiime

    hiroko <h_ogawa@rnk.co.jp> — 2001-05-15T08:49:36Z

    hi all.
    
    from a DB table, I'd like to SELECT out the date of 3months before.
    the command should be
    
    => select * from MYTBL where time =XXXXXX ;
    
    what whould it like to be at XXXXX ?
    I thought that I can use the type of 'today', which is meant to be the
    0:00am of the day.
    or 'current' or things like this. but how can you make it "0:00am of three
    days ago"?
    
    also, if you know about it,
    I'd like to know about the difference between 'current' and 'now'.
    
    thanks about that.
    
    hiroko ogawa
    
    
    
  2. Re: Tiiiiiiiiiiiiime

    Ryan Mahoney <ryan@paymentalliance.net> — 2001-05-16T20:36:12Z

    This is a guess - have you tried:
    
    SELECT * FROM tableName WHERE time = CURRENT_TIMESTAMP - '3 months'::interval
    
    let me know if it works!
    
    -r
    
    
    At 05:49 PM 5/15/01 +0900, hiroko wrote:
    
    >hi all.
    >
    >from a DB table, I'd like to SELECT out the date of 3months before.
    >the command should be
    >
    >=> select * from MYTBL where time =XXXXXX ;
    >
    >what whould it like to be at XXXXX ?
    >I thought that I can use the type of 'today', which is meant to be the 
    >0:00am of the day.
    >or 'current' or things like this. but how can you make it "0:00am of three 
    >days ago"?
    >
    >also, if you know about it,
    >I'd like to know about the difference between 'current' and 'now'.
    >
    >thanks about that.
    >
    >hiroko ogawa
    >
    >
    >
    >---
    >Incoming mail is certified Virus Free.
    >Checked by AVG anti-virus system (http://www.grisoft.com).
    >Version: 6.0.251 / Virus Database: 124 - Release Date: 4/26/01
    
    
  3. Re: Tiiiiiiiiiiiiime

    Alexander Dederer <dederer@spb.cityline.ru> — 2001-05-16T21:28:11Z

    hiroko wrote:
    > from a DB table, I'd like to SELECT out the date of 3months before.
    > the command should be
    >
    > => select * from MYTBL where time =XXXXXX ;
    >
    > what whould it like to be at XXXXX ?
    
    Try this:
    SELECT  *  FROM mytbl  WHERE create_date > (now() - '3 month'::interval) ;
    
    See date/time function manual.