Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do
Message
From
23/04/2008 03:39:17
 
 
To
23/04/2008 03:16:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01312556
Message ID:
01312570
Views:
20
This message has been marked as the solution to the initial question of the thread.
>Fabio,
>
>now I get ERROR 1814 Queries of this type are not supported. It looks like he don't like ordr by or TOP.
>
>Agnes
CREATE CURSOR curSource (dDate D , nValue  I)
INSERT INTO curSource VALUES (DATE(2008,1,1),5)
INSERT INTO curSource VALUES (DATE(2008,1,10),3)

* THIS IS THE SQL CORRECT SOLUTION, BUT VFP SQL is too limited
SELECT;
 dDate;
, nValue - NVL((SELECT TOP 1 nValue FROM curSource WHERE dDate>X.dDate ORDER BY dDate),0);
 FROM curSource X;
 ORDER BY 1
 
* climbing on mirrors
 SELECT;
 X.dDate;
, X.nValue - NVL(X1.nValue,0);
 FROM curSource X;
 LEFT JOIN curSource X1 ON X1.dDate>X.dDate;
 WHERE X1.dDate=(SELECT MIN(dDate) FROM curSource WHERE dDate>X.dDate) OR X1.dDate IS NULL;
 ORDER BY 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform