× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



As you say, it is not the best tool for this.
But, as an exercise, I would probably start like this:
Join the file back to itself on Symbol.
Calculate the difference in days between t2.date and t1.date.
Select the records where the difference is 1.
Calculate the difference between t2.value and t1.value.



-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Rene van der Kraats
Sent: Monday, February 09, 2015 7:54 AM
To: Midrange Systems Technical Discussion
Subject: Can someone help me with my Query/400 quest? (yes, I know, it's prehistoric ;)

Hi All,

I hate to ask for help with this as I'm trying to discover as much as
possible myself, but I'm afraid I'm a bit stuck here.

I'm dabbling with Query/400 (just for entertainment, mind you) but, never
having used this program before, it's a bit hard to get into the right
'mind-set'.

I have these database files with a layout similar to this:

DATE SYMBOL VALUE
01/01/2015 AAA 50
01/01/2015 BBB 40
01/01/2015 CCC 20
01/02/2015 AAA 60
01/02/2015 BBB 35
01/02/2015 CCC 25
01/03/2015 AAA 40
01/03/2015 BBB 25
01/03/2015 CCC 23

etc...

I'm trying to produce a query where it calculates the delta between
similar symbols, per day.

So:

01/01/2015 AAA = 50
01/02/2015 AAA = 60 -> delta compared to previous day = 10
01/03/2015 AAA = 40 -> delta compared to previous day = 20

...and so on, for each symbol.

I think I need to build some query result fields roughly like 'delta =
abs(VALUE(current date) - VALUE(current date - 1))' (I hope this makes
sense), but I cannot figure out how to do this.
I've read a boat-load of PDF's, but none really shows me how to approach
this problem (or perhaps I just don't 'get it' :)

Can someone perhaps push me in the right direction? I know this probably
can be solved much easier and quicker with other tools, but out of
curiosity I'd still like to know how this is accomplished in Query/400 :)

Regards,

Rene.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.