Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 6 Sql Question using dates
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
VFP 6 Sql Question using dates
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP3
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00953528
Message ID:
00953528
Views:
49
Windows 2000, VFP 6.0, SQL Server 2000
Cumulative totals:

Desired:

1. User enters a date in a textbox.

2. The textbox format is D && for date / /

3. Crusors (cuDetail and cuRework) are created using SQL Pass thru and work fine with the date entry via the textbox.

4. The two cursors are combined as shown below, and without the line AND cuDetail.CreatedDate <= ldDate, work as desired.

5. Using the value from the textbox gives an error “Operator/Operand type mismatch.

6. I have tried CTOD, and other functions to convert the date with no luck.

7. How do I get this to work with the date selection entered by the user via the textbox?



* ldDate = Thisform.cntStartDate.txtDate.Value && This will crash and burn.
* ldDate = {^2004/08/06 11:59:59 PM} && This works.

Select cuDetail.PartNumber, cuDetail.ReworkNumber, cuDetail.Kanban, ;
SUM(cuDetail.TotalOK) AS CtTotal, SUM(cuDetail.OK) AS CtOK, ;
SUM(cuDetail.Reworked) AS CtReworked, SUM(cuDetail.Rejected) AS CtRejected ;
from cuReworkNumber, cuDetail ;
WHERE cuReworknumber.ReworkNumber = cuDetail.ReworkNumber ;
AND cuDetail.CreatedDate <= ldDate ;
GROUP BY cuDetail.ReworkNumber, cuDetail.PartNumber ;
into cursor cuCumulativeTotal ;
ORDER BY cuDetail.ReworkNumber, cuDetail.PartNumber




Thank you in advance.

Tom
Next
Reply
Map
View

Click here to load this message in the networking platform