pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQL Date  help
2+ messages / 2 participants
[nested] [flat]

* SQL Date  help
@ 2001-03-26 08:24  waheed_rahuman <waheed_rahuman@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: waheed_rahuman @ 2001-03-26 08:24 UTC (permalink / raw)
  To: pgsql-sql



Hi,

I am a newbie to SQL and postgresql too.
please guide me in the following...


1.How i can create date while i am inserting into the table ,in which the
field is date data type.(date should not be a current date and its should be
created
as in java date(int,int,int)

2. How i can compare the date field.
For example ,
how i can get the all the records between to two dates

please help in this regards

i thank you
regards
waheed




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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: SQL Date  help
@ 2001-03-26 08:58  Karel Zak <zakkr@zf.jcu.cz>
  parent: waheed_rahuman <waheed_rahuman@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Karel Zak @ 2001-03-26 08:58 UTC (permalink / raw)
  To: waheed_rahuman <waheed_rahuman@yahoo.com>; +Cc: pgsql-sql

On Mon, Mar 26, 2001 at 12:24:07PM +0400, waheed_rahuman wrote:
> 
> 
> Hi,
> 
> I am a newbie to SQL and postgresql too.
> please guide me in the following...

 Any problem with documentation?

> 1.How i can create date while i am inserting into the table ,in which the
> field is date data type.(date should not be a current date and its should be
> created
> as in java date(int,int,int)

 INSERT INTO xxx VALUES (now());
 INSERT INTO xxx VALUES ('2000-01-01');

> 2. How i can compare the date field.

via standard operators, en example '<' '>' '=' 'between' ..etc. 

> For example ,
> how i can get the all the records between to two dates

  SELECT .... WHERE col BETWEEN '2000-01-01' AND '2001-01-01';
 
 Please(!), see

http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm
http://www.postgresql.org/users-lounge/docs/7.0/user/operators.htm
http://www.postgresql.org/users-lounge/docs/7.0/user/operators2373.htm  

		Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-03-26 08:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26 08:24 SQL Date  help waheed_rahuman <waheed_rahuman@yahoo.com>
2001-03-26 08:58 ` Karel Zak <zakkr@zf.jcu.cz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox