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 filterd by months
Sat, Nov 21 2009 5:58 AMPermanent Link

"Sorin H"
Hello

I try to create a sql statement where the result are filter by months
difference.

The 'WHERE (DATE '2009-12-31' - DataDate) > 18'  compare days
The  'WHERE (DATE '2009-12-31' - DataDate) > INTERVAL '18' MONTH' raise an
error

What is the right syntax?
Thanks Sorin

Sat, Nov 21 2009 7:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sorin


select _Invoiced, _invoiced - interval '18' month  from invoices
where
(_invoiced - interval '18' month) > date '2006-04-08'


Roy Lambert
Sun, Nov 22 2009 10:32 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Sorin,

<< I try to create a sql statement where the result are filter by months
difference.

The 'WHERE (DATE '2009-12-31' - DataDate) > 18'  compare days
The  'WHERE (DATE '2009-12-31' - DataDate) > INTERVAL '18' MONTH' raise an
error >>

Use this:

SELECT *
FROM MyTable
WHERE (DATE '2009-12-31' - DataDate) MONTH > INTERVAL '18' MONTH

--
Tim Young
Elevate Software
www.elevatesoft.com

Image