Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
VFP 6 Sql Question using dates
Versions des environnements
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement