Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 6 Sql Question using dates
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
VFP 6 Sql Question using dates
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP3
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00953528
Message ID:
00953528
Vues:
50
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
Fil
Voir

Click here to load this message in the networking platform