Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems summing values in one field between 2 dates
Message
From
04/03/2000 14:30:00
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00341684
Message ID:
00341711
Views:
23
>Now how do i put the results into another text box somthing like this but it gives me a syntex error
>local setdate1 setdate2
>setdate1 = thisform.text1.value
>setdate2 = thisform.text3.value
>
>SELECT SUM(Inv.soldprice);
> FROM pawn!Inv;
> WHERE Inv.solddate BETWEEN setdate1 AND setdate2 ;
> into thisform.text2.value <<< this probably not right.
>

The target for a SQL SELECT must be a table, cursor or array; you can do something like the following instead:

SELECT 0
USE pawn!Inv AGAIN ALIAS (SYS(2015))
SUM soldprice TO thisform.text2.value FOR BETWEEN(solddate,setdate1,setdate2)
USE
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