Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread select data after today
Thu, Mar 1 2007 4:45 AMPermanent Link

"Harry de Boer"
dbIsam 3.3. D6

LS.

I have a table with two integer fields year and month. How do I get all the
data (sql statement) where the year-month combination is not in the past
(so: today's year/month and the year/months ahead).

Regards, Harry

Thu, Mar 1 2007 5:07 AMPermanent Link

Chris Erdal
"Harry de Boer" <harry@staaf.nl> wrote in
news:67DC0DB9-48F5-4083-A3A1-7727188703A8@news.elevatesoft.com:

> I have a table with two integer fields year and month. How do I get
> all the data (sql statement) where the year-month combination is not
> in the past (so: today's year/month and the year/months ahead).
>

SELECT *
WHERE YearFld*100+MonthFld >= EXTRACT(YEAR,CURRENT_DATE)*100+EXTRACT
(MONTH,CURRENT_DATE)

--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 3 + EDB 1.00 build 6)
Thu, Mar 1 2007 7:58 AMPermanent Link

"Harry de Boer"
Chris,

Thanks Changed it to:
EXTRACT(YEAR FROM CURRENT_DATE)
works like a charm!

Harry



"Chris Erdal" <chris@No-Spam-erdal.net> schreef in bericht
news:Xns98E66FFC9EC8014torcatis@64.65.248.118...
> "Harry de Boer" <harry@staaf.nl> wrote in
> news:67DC0DB9-48F5-4083-A3A1-7727188703A8@news.elevatesoft.com:
>
> > I have a table with two integer fields year and month. How do I get
> > all the data (sql statement) where the year-month combination is not
> > in the past (so: today's year/month and the year/months ahead).
> >
>
> SELECT *
> WHERE YearFld*100+MonthFld >= EXTRACT(YEAR,CURRENT_DATE)*100+EXTRACT
> (MONTH,CURRENT_DATE)
>
> --
> Chris
> (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 3 + EDB 1.00 build 6)
>

Image