[SQL] How to get the previous date?

2009-10-14 Thread Shruthi A
Hi,

I'm using Enterprise DB PostgresPlus version 8.3.
Is there is a simple function or command like previous_date(mydate) which
when passed a particular date, simply returns the previous date? I tried

mydate - 1

but this doesnt work.

Thanks,
Shruthi


Re: [SQL] How to get the previous date?

2009-10-14 Thread Dmitriy Igrishin
Hello.

current_date - 1 is the solution.

2009/10/14 Shruthi A 

> Hi,
>
> I'm using Enterprise DB PostgresPlus version 8.3.
> Is there is a simple function or command like previous_date(mydate) which
> when passed a particular date, simply returns the previous date? I tried
>
> mydate - 1
>
> but this doesnt work.
>
> Thanks,
> Shruthi


Re: [SQL] How to get the previous date?

2009-10-14 Thread ramasubramanian
Helo Madam,
Here is the query.
select now()+ interval '-1  day '
Regards,
ram
  - Original Message - 
  From: Shruthi A 
  To: pgsql-sql@postgresql.org 
  Sent: Wednesday, October 14, 2009 3:10 PM
  Subject: [SQL] How to get the previous date?


  Hi, 

  I'm using Enterprise DB PostgresPlus version 8.3. 
  Is there is a simple function or command like previous_date(mydate) which 
when passed a particular date, simply returns the previous date? I tried 

  mydate - 1 

  but this doesnt work. 

  Thanks, 
  Shruthi 

[SQL] How to order varchar data by word

2009-10-14 Thread Oliveiros C,
 Hello, list.

I have a table with a varchar field that I would like to order by word, not by 
ordinal, which seems to be the default on postgres.

Does anyone have a clue on how this can be done?

Many thanx in advance,

Best,
Oliveiros

Re: [SQL] How to get the previous date?

2009-10-14 Thread msi77
Try this:

select cast(mydate as date) -1

> Hi, 
> I'm using Enterprise DB PostgresPlus version 8.3. 
> Is there is a simple function or command like previous_date(mydate) which 
> when passed a particular date, simply returns the previous date? I tried 
> mydate - 1 
> but this doesnt work. 
> Thanks, 
> Shruthi 

Почта со встроенным плеером находится здесь: 
http://mail.yandex.ru/promo/new/wysiwyg   

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] How to order varchar data by word

2009-10-14 Thread Adrian Klaver
On Wednesday 14 October 2009 7:13:22 am Oliveiros C, wrote:
>  Hello, list.
>
> I have a table with a varchar field that I would like to order by word, not
> by ordinal, which seems to be the default on postgres.
>
> Does anyone have a clue on how this can be done?
>
> Many thanx in advance,
>
> Best,
> Oliveiros

Can you show the SQL you are using?

-- 
Adrian Klaver
akla...@comcast.net

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql