Jbase query to select last 14 days data

1.7k views Asked by At

I am new to jbase and stuck in one query. I want to extract last 14 days data using jbase. I have written the following query :

Select filename WITH DATE > '14-MAY-2013'

I hardcoded '14-MAY-2013', becouse I dont know how to get currentdate i used CURRENTDATE also but hard luck .

4

There are 4 answers

0
Osama Adil On

Try the following Select command

SELECT filename WITH DATE GE 20130514. 

To get the current date you can use the global jbase variable TODAY.

SELECT filename WITH DATE GE TODAY.

0
alinboby On

To get the current date you can use the global jbase variable TODAY.

SELECT filename WITH DATE EQ TODAY.

EQ works as a equal sign.

0
Tunji Adegbite On

Try WITH DATE GE TODAY. If that does not work, try and give more information about your issue and what you are trying to achieve.

0
PrecisionLex On

You can use EVAL to write a program inside your SELECT or LIST statement. In your case it depends on what format the DATE field is stored in the jBase.

For example you could write something like this:

SELECT filename WITH DATE GE EVAL "OCONV(DATE()-14, 'D-YMD')"

The "DATE()-14" will return current date as number of days since December 31, 1967 minus 14 days, OCONV(x, 'D-YMD') will format the x to a date separated by '-' dashes.