General information
Title:
SQL select questions.
I have two questions :
1. The following code
VNRCRT=0
SELECT NRCRT() AS NC,NAME FROM ADDBOOK
FUNCTION NRCRT
VNRCRT=VNRCRT+1
RETURN VNRCRT
return the following cursor :
nc name
== =====
2 john
3 mark
....
It seems that NRCRT() is called twice for the first record. Is
this a feature? Is this a bug? There is any (logical) reason for
this behaviour?
2. I'm using something like :
SELECT FIELD1, FIELD2, UDF1() AS CFIELD1 FROM TABLEA INTO CURSOR CURSOR1
The UDF1 return a numeric value. There is any way to force VFP to create
the CFIELD1
cursor field with a specified lenght and decimal digits?
3. I have a table like
DATE AMOUNT
==== =======
01/01 10
01/02 5
01/05 7
There is any way to create a cursor with a "running total" additional field
like
DATE AMOUNT TOTAL
==== ======= =======
01/01 10 10
01/02 5 15
01/05 7 22
using only one SQL select without any UDF?
Thank's
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only