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 12:41:43
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00341684
Message ID:
00341687
Views:
22
>I'm new at visual fox pro trying to sum records from a field that is called paidamout between certain matching dates which a user will input in 2 text boxes that will match up with a field called paiddate. Then hit a button that runs my select sum statement. The problem is if I put in a fixed date in the where statement like WHERE Inv.solddate = {5/30/95} it works but, when I try to get it from the text box value it gives me this error that says operator/operand type mismatch. Here is my select statement, which I have in the procedure of the command button.
>
>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
>

Have you initialized the values for text1 and text2 with dates? If not, the odds are that a character expression rather than an date is being passed.
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
Next
Reply
Map
View

Click here to load this message in the networking platform