Re: Aww, sorry (last day of month)
| От | Thomas Lockhart |
|---|---|
| Тема | Re: Aww, sorry (last day of month) |
| Дата | |
| Msg-id | 39634B5F.4ABB9DE4@alumni.caltech.edu обсуждение |
| Ответ на | Aww, sorry (last day of month) (Antti Linno <alligator@all.ee>) |
| Список | 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
В списке pgsql-sql по дате отправления: