pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Aww, sorry (last day of month)
2+ messages / 2 participants
[nested] [flat]

* Aww, sorry (last day of month)
@ 2000-07-05 12:55  Antti Linno <alligator@all.ee>
  0 siblings, 1 reply; 2+ messages in thread

From: Antti Linno @ 2000-07-05 12:55 UTC (permalink / raw)
  To: pgsql-sql

I thought, I finished that group by theme. 

What i ment was, that I have information about workers, and I have to make
report on them. Report should contain status about workers with the
restriction , that the data is about last day of the month. I use perl as
a scripting language, and how the hell should I know how many days were in
that particular month (28,29,30,31) :). If there are no means by doing it
in sql, I write a code to ask for a , mmm, special day. *sigh*
Maybe something with date_trunc?

Thanx for discussion though.

Antti,
greetings from estionia :P





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

* Re: Aww, sorry (last day of month)
@ 2000-07-05 14:51  Thomas Lockhart <lockhart@alumni.caltech.edu>
  parent: Antti Linno <alligator@all.ee>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Lockhart @ 2000-07-05 14:51 UTC (permalink / raw)
  To: Antti Linno <alligator@all.ee>; +Cc: pgsql-sql

> What i ment was, that I have information about workers, and I have to make
> report on them. Report should contain status about workers with the
> restriction , that the data is about last day of the month. I use perl as
> a scripting language, and how the hell should I know how many days were in
> that particular month (28,29,30,31) :). If there are no means by doing it
> in sql, I write a code to ask for a , mmm, special day. *sigh*
> Maybe something with date_trunc?

Someone else had the suggestion, but specifically something like

  ... where d1 >= (date_trunc('month', timestamp 'today') - interval '1
day')
       and d1 < date_trunc('month', timestamp 'today');

should get you data for the previous month. Substitute the "today" field
for something else as you may require.

                        - Thomas



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


end of thread, other threads:[~2000-07-05 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-07-05 12:55 Aww, sorry (last day of month) Antti Linno <alligator@all.ee>
2000-07-05 14:51 ` Thomas Lockhart <lockhart@alumni.caltech.edu>

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