Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Help with SQL and date expression
Sun, Jul 19 2009 11:47 PMPermanent Link

"Adam H."
Hi,

I'm trying to run the following SQL statement in EDB. It works with DBISam,
but not EDB and was wondering what is the correct method to execute this in
EDB?

select * from Log
where (0=0)
/*1*/ and (DateTime > (current_date - 60))
order by Record


The line marked as /*1*/ is where the problem occurs (or particularly with
the current_date - 60 expression). I'm trying to retrieve a list of records
that exist within the last 60 days of when the script is ran.


Also - as a minor issue, I've noticed in the EDB Manager (Unicode) 1.09b4
the above is not displayed correctly. The line I'm having problems with is
all showing in 'comment italic green', instead of just the text between the
/* and */.  I don't believe this is related, but probably just a small
overlook in the EDB Manager code.

Cheers

Adam.
Mon, Jul 20 2009 3:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


Congratulations you found intervals Smiley

ElevateDB follows the SQL2003 standard so the good old simple date subtraction etc is no longer there

Something like

select * from Log
where (0=0)
/*1*/ and (current_date - DateTime INTERVAL DAY) > (current_date - 60))
order by Record

should work. Not tested and INTERVALs is one of the concepts in ElevateDB my poor old brain has trouble with.

Roy Lambert [Team Elevate]
Mon, Jul 20 2009 10:49 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Adam,

SELECT
  *
FROM
  Log
WHERE
  DateTime > (CURRENT_DATE - INTERVAL '60' DAY)
ORDER BY
  Record

--
Fernando Dias
[Team Elevate]
Mon, Jul 20 2009 11:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Adam,

<< Also - as a minor issue, I've noticed in the EDB Manager (Unicode) 1.09b4
the above is not displayed correctly. The line I'm having problems with is
all showing in 'comment italic green', instead of just the text between the
/* and */.  I don't believe this is related, but probably just a small
overlook in the EDB Manager code. >>

This has since been fixed, although I'm not sure when because it appears as
though it wasn't logged.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image