Unix Technical Forum

How do I do a dynamic - select now() + interval X days ?

This is a discussion on How do I do a dynamic - select now() + interval X days ? within the pgsql Admins forums, part of the PostgreSQL category; --> Thanks Danny Abraham BMC Software CTM&D Business Unit 972-52-4286-513 danny_abraham@bmc.com ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 08:04 AM
Abraham, Danny
 
Posts: n/a
Default How do I do a dynamic - select now() + interval X days ?

Thanks

Danny Abraham
BMC Software
CTM&D Business Unit
972-52-4286-513
danny_abraham@bmc.com


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:04 AM
=?iso-8859-1?q?Rodrigo_De_Le=F3n?=
 
Posts: n/a
Default Re: How do I do a dynamic - select now() + interval X days ?

On Aug 8, 9:54 am, danny_abra...@bmc.com ("Abraham, Danny") wrote:
> Thanks


Please be more specific...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 08:04 AM
Jon Sime
 
Posts: n/a
Default Re: How do I do a dynamic - select now() + interval X days?

Abraham, Danny wrote:
> Thanks


For doing that based on an arbitrary value, just do the following:

select now() + interval '1 day' * X;

-Jon

--
Senior Systems Developer
Media Matters for America
http://mediamatters.org/

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 08:04 AM
Kristo Kaiv
 
Posts: n/a
Default Re: How do I do a dynamic - select now() + interval X days ?


On 08.08.2007, at 18:16, Jon Sime wrote:

> Abraham, Danny wrote:
>> Thanks

>
> For doing that based on an arbitrary value, just do the following:
>
> select now() + interval '1 day' * X;
>
> -Jon
>

test=# select (3||' day')::interval;
interval
----------
3 days
(1 row)

> --
> Senior Systems Developer
> Media Matters for America
> http://mediamatters.org/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match


Kristo Kaiv
http://kaiv.wordpress.com (PostgreSQL blog)



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com