Questions on 'datetime' parameters - Mailing list pgsql-novice

From Dave_Pfaltzgraff@patapsco.com
Subject Questions on 'datetime' parameters
Date
Msg-id 852569E3.0054B5F2.00@patapsco.com
Whole thread Raw
List pgsql-novice



Dave Pfaltzgraff@PATAPSCO
01/29/2001 10:25 AM

I have a table defined as:

Table    = associate
+---------------------+----------------------------------+-------+
|        Field        |              Type                | Length|
+---------------------+----------------------------------+-------+
| as_id               | int4 not null                    |     4 |
| as_card             | char()                           |    10 |
| as_end              | datetime default ( now ( ) + 31 )|     8 |
+---------------------+----------------------------------+-------+

and would like to select entries where as_end is prior to the current
time. Which of the following would be the correct SQL statement?

SELECT AS_Card, AS_ID INTO ntemp FROM Associate WHERE AS_End < time('now');

or:

SELECT AS_Card, AS_ID INTO ntemp FROM Associate WHERE AS_End < 'now';

or, is there another form better... like maybe 'now'::datetime ...?

Thanks,
Dave



pgsql-novice by date:

Previous
From: Herb Pabst
Date:
Subject: Re: Still lockin up...
Next
From: Eric Frazier
Date:
Subject: DatabaseMetaData - getTables and weird data types