General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
VFP 6 Sql Question using dates
Environment versions
Network:
Windows 2000 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only