Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using select statement
Message
From
05/02/2001 20:06:46
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00472583
Message ID:
00472754
Views:
26
>I am trying to bring records into my array using select statements. Instead of bringing in a number of records that match the criteria, is a there a command to bring in only one record into array (perferable last record). For example:
>
>my table has following fields
>year, fica1, totamt
>
>follow data exist in table AMT_table
>
>Year, Fica1, Totamt
>99, 1, 21
>00, 1, 22
>00, 1, 22
>00, 0, 10
>00, 0, 10
>00, 1, 23
>00, 1, 23
>
>
>when I issue follow command Select Totamt From AMT_table into array test Where Year = 00 and Fica1 = 1
>
>The following result comeout
>
>test(1,1) = 22
>test(2,1) = 22
>test(3,1) = 23
>test(4,1) = 23
>
>is the a way I can use select statement to give just the last record instead of filling the array with 4 elements. In my program, The data I try to extract is on a much larger scale (300 records may show up in array) and I only need the last record (or figures).
>

SELECT MAX(totamt) as TOTAMT FROM AMT_Table INTO ARRAY TEST WHERE Year = 00 and Fical = 1

Now it will provide the single largest amount as test(1)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform