Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can someone tell me why this query does not work?
Message
De
10/12/2013 13:13:28
 
 
À
10/12/2013 11:51:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01589692
Message ID:
01589708
Vues:
63
>Hi all.
>
>I have beat my head on the keyboard for long enough. Here is the query (angle brackets have been replaced by square brackets for readability here)
>
>
>TEXT TO lcSQL TEXTMERGE NOSHOW PRETEXT 15
>    SELECT DATETIME(YEAR(VEH.EvtDate), MONTH(VEH.EvtDate), DAY(VEH.EvtDate), VAL(GETWORDNUM(VEH.EvtTime, 1, ":")), VAL(GETWORDNUM(VEH.EvtTime, 2, ":"))) AS start_time, 
>	DATETIME(YEAR(VEH.EvtDate), MONTH(VEH.EvtDate), DAY(VEH.EvtDate), VAL(GETWORDNUM(VEH.EvtTime, 1, ":")), VAL(GETWORDNUM(VEH.EvtTime, 2, ":"))) + ((VAL(GETWORDNUM(VEH.duration, 1, ':')) * 3600) + (VAL(GETWORDNUM(VEH.duration, 2, ':')) * 60)) AS end_time, 
>	ST.descr AS SvcType_dsc, SVC.servref 
>    FROM funeral!ServiceVehicle VEH WITH (BUFFERING = .T.) 
>	JOIN aserdet SVC WITH (BUFFERING = .T.) ON VEH.service_id = SVC.serviceid 
>	JOIN psvctype ST ON SVC.servtype = ST.code 
>	WHERE VEH.VehCode =  '[[tcVehCode]]'  
>		AND VEH.SvcVehID # [[tiSvcVehID]]  
>		AND DATETIME(YEAR(VEH.EvtDate), MONTH(VEH.EvtDate), DAY(VEH.EvtDate), VAL(GETWORDNUM(VEH.EvtTime, 1, ":")), VAL(GETWORDNUM(VEH.EvtTime, 2, ":"))) < {[[ttEndTime]]} 
>		AND DATETIME(YEAR(VEH.EvtDate), MONTH(VEH.EvtDate), DAY(VEH.EvtDate), VAL(GETWORDNUM(VEH.EvtTime, 1, ":")), VAL(GETWORDNUM(VEH.EvtTime, 2, ":"))) + ((VAL(GETWORDNUM(VEH.duration, 1, ':')) * 3600) + (VAL(GETWORDNUM(VEH.duration, 2, ':')) * 60)) > {[[ttStartTime]]}
>ENDTEXT 
>
>
>It hands me back Function argument value, type, or count is invalid.

I assume you've grabbed the generated query and tested it from the Command Window?

One other thought. It appears that EvtTime and Duration must be in the form "HH:MM" Is it possible that you have some data that's only "H:MM"?

If neither of those produces anything useful, can you give us some CREATE CURSORs and INSERTs to generate some sample data?

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform