Thread: problem with date/time constants

problem with date/time constants

From
"datactrl"
Date:
Hi, 
server:PostgreSQl 7.1
why doesn't following statement work?
"select now;"

THANK YOU!
JACK LIU




Re: problem with date/time constants

From
Alex Pilosov
Date:
You must either do:
select now();

or

select 'now'::timestamp;

now() is a function that takes no arguments.

it is also a special value recognized by timestamp parser.


On Tue, 3 Jul 2001, datactrl wrote:

> Hi, 
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
> 
> THANK YOU!
> JACK LIU
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl
> 
> 



Re: problem with date/time constants

From
David Stanaway
Date:
On Tuesday, July 3, 2001, at 10:44  PM, datactrl wrote:

> Hi,
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"

Tried rtfm? :P
How about:

SELECT CURRENT_TIMESTAMP as now;

--
Best Regards
David Stanaway
========================.---------------------------------------------
Technology Manager  -  Australia's Premier Internet Broadcasters
david@NetVentures.com.au     Office +612 9357 1699
========================'---------------------------------------------


Re: problem with date/time constants

From
Jan Wieck
Date:
datactrl wrote:
> Hi,
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
   Because it's not standard SQL and now is a function.
   Use either
       SELECT CURRENT_TIMESTAMP;
   which is standard (preferred) or
       SELECT now();


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Re: problem with date/time constants

From
Bhuvan A
Date:
Hi,

'now' is a function... 
so try 'select now();'

On Tue, 3 Jul 2001, datactrl wrote:

> Hi, 
> server:PostgreSQl 7.1
> why doesn't following statement work?
> "select now;"
> 
> THANK YOU!
> JACK LIU
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://www.postgresql.org/search.mpl
>