Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last filled column
Message
From
03/05/2008 08:44:27
 
 
To
03/05/2008 08:08:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01314907
Message ID:
01314909
Views:
7
This is one of solution.
Of course, you can modify it to your needs.
SELECT TOP 1 * FROM price ORDER BY date DESC INTO CURSOR LastPrice

=AFIELDS(columnsx, "lastprice")
FOR i = 2 TO ALEN(columnsx,1)
	columnName = columnsx[i,1]
	columnValue = "LastPrice."+columnName
	columnValue = EVALUATE(columnValue)
	
	IF columnValue <> 0
		LastValue = columnValue
	ENDIF
ENDFOR

? LastValue
>Dear Experts
>
>Price.dbf has following Five fields
>
>date ---- d(8)
>rate1 ---n(4)
>rate2 ---n(4)
>rate3 ---n(4)
>rate4 ---n(4)
>
>Data in fields as
>
>Date ---- rate1-----rate2-----rate3------rate4
>22/01-----195---------0----------0----------0---
>24/01-----195-------180---------0----------0---
>25/01-----225-------230-------215---------0--
>24/01-----335-------180-------200-------205
>
>Text1.value=25/1
>
>How to findout the value in last filled column in four columns i.e rate1,rate2,rate3 and rate4.
>
>The answer must be 215
>
>Please help
Previous
Reply
Map
View

Click here to load this message in the networking platform