Today's Date in SELECT

174 views
Skip to first unread message

ww

unread,
Feb 5, 2009, 11:56:53 AM2/5/09
to jBASE
Is there a way to list items = today's date ie;

LIST THE.DATE WITH THE.DATE > TODAY

Where TODAY is the system date.

Thanks in advance,

ww

Dan Ell

unread,
Feb 5, 2009, 1:29:28 PM2/5/09
to jBASE
Ww,

Probably the easiest way is to a dict called FUTURE with a correlative
that subtracts today's date. Assuming the date to compare was in
attribute 7...

FUTURE
001 A
002 0
003 Future
004
005
006
007
008 A:7-D
009 R
010 6

Then SELECT filename WITH FUTURE > "0" would give you all "future"
dates.

Dan Ell

Jim Idle

unread,
Feb 5, 2009, 2:53:09 PM2/5/09
to jB...@googlegroups.com
Dan Ell wrote:
> Ww,
>
> Probably the easiest way is to a dict called FUTURE with a correlative
> that subtracts today's date. Assuming the date to compare was in
> attribute 7...
>
> FUTURE
> 001 A
> 002 0
> 003 Future
> 004
> 005
> 006
> 007
> 008 A:7-D
> 009 R
> 010 6
>
> Then SELECT filename WITH FUTURE > "0" would give you all "future"
> dates.
>
> Dan Ell
Well, jBASE 4.1 and up supports DICT to DICT comparison, so you can
create a DICT entry called TODAY that returns todays date, then say:

LIST filename WITH DATE.FIELD > TODAY

Of course, if you run that at one second before midnight...

Jim

pat

unread,
Feb 5, 2009, 2:56:44 PM2/5/09
to jBASE
'DICT' to 'DICT' comparisions are also available on jBASE 3.4.10, for
anyone still using jBASE 3.4

And also on jBASE 4.0 for any of our Temenos brethren still using
jBASE 4.0

Pat ;-)

Jim Idle

unread,
Feb 5, 2009, 2:58:55 PM2/5/09
to jB...@googlegroups.com
pat wrote:
> 'DICT' to 'DICT' comparisions are also available on jBASE 3.4.10, for
> anyone still using jBASE 3.4
>
> And also on jBASE 4.0 for any of our Temenos brethren still using
> jBASE 4.0
>
> Pat ;-)
>
I could not remember if we had done that - I am getting old... sorry, eld.

Jim

pet...@versys.net

unread,
Feb 5, 2009, 3:12:29 PM2/5/09
to jB...@googlegroups.com

Suppose you did have that as a SELECT in a program and the
SELECT did run for a minute or so, if the date changed when
it was 50% through the file, I assume the remaining 50%
would use the new date - is that correct ?

Suppose you had something like this in an SQL environment,
or even a jBASE environment accessing SQL tables, what would
happen with this statement if the date changed half way
through processing?

UPDATE something in sometable WHERE DATE.FIELD > CURR.DATE

Peter

Jim Idle

unread,
Feb 5, 2009, 3:38:30 PM2/5/09
to jB...@googlegroups.com
pet...@versys.net wrote:

Well, jBASE 4.1 and up supports DICT to DICT comparison, so
    
you can create a >DICT entry called TODAY that returns
todays date, then say:
  
LIST filename WITH DATE.FIELD > TODAY

Of course, if you run that at one second before midnight...

Jim
    
Suppose you did have that as a SELECT in a program and the
SELECT did run for a minute or so, if the date changed when
it was 50% through the file, I assume the remaining 50%
would use the new date - is that correct ?
  
Actually it depends on how the query is formulated, but generally the dictionary reference would be evaluated for each record and yes! :-)

So, what you should really do is:

Dat = DATE()

And then EXECUTE the query:  "/.. WHERE DATE-FIELD > ":Dat

Assuming that the DATE-FILE was raw format, but converting to output format to generate the query otherwise. Then the data you are checking is fixed for that query duration.

Jim

ww

unread,
Feb 5, 2009, 4:07:47 PM2/5/09
to jBASE
Thanks Jim, now how do I create a DICT entry called TODAY that
returns todays date?

Thanks in advance,

ww
> Jim- Hide quoted text -
>
> - Show quoted text -

Ed Clark

unread,
Feb 5, 2009, 6:27:25 PM2/5/09
to jB...@googlegroups.com
jbase also supports EVAL. It's probably not much better than the
other suggestions, but it does open up possibilities for ad-hoc
queries that don't require you to create dictionary entries (which 7
other programmers probably already have, which is why the dictionary
of your customer file is bigger than the data section):

LIST filename WITH DATE.FIELD > EVAL "DATE()"

Mark Hogden

unread,
Feb 5, 2009, 6:51:49 PM2/5/09
to jB...@googlegroups.com
TODAY
001 S
002 0
003
004
005
006
007 D2/
008 A;D
009 R
010 8

If you use an MD then best to stick in there so it can be used with any
file.

-----Original Message-----
From: jB...@googlegroups.com [mailto:jB...@googlegroups.com] On Behalf Of ww

Jim Idle

unread,
Feb 5, 2009, 10:08:53 PM2/5/09
to jB...@googlegroups.com
Ed Clark wrote:
> jbase also supports EVAL.
Yep

> It's probably not much better than the
> other suggestions, but it does open up possibilities for ad-hoc
> queries that don't require you to create dictionary entries (which 7
> other programmers probably already have, which is why the dictionary
> of your customer file is bigger than the data section):
>
:-)

Jim

ww

unread,
Feb 9, 2009, 2:46:46 PM2/9/09
to jBASE
Thanks that did the trick.
> ww- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages