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 14:38:39
 
 
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:
01589735
Vues:
63
Hi Naomi.

I used your tip about using a derived table to get my query working:

Hi Naomi.

Thanks for the tip on using a derived table - I never even thought about it. I finally got this query working:
TEXT TO lcSQL TEXTMERGE NOSHOW PRETEXT 15
	SELECT * FROM 
		(SELECT DTOT(VEH.EvtDate) + ((VAL(GETWORDNUM(VEH.EvtTime, 1, ":")) * 3600) + (VAL(GETWORDNUM(VEH.EvtTime, 2, ":")) * 60)) AS start_time, 
				DTOT(VEH.EvtDate) + ((VAL(GETWORDNUM(VEH.EvtTime, 1, ":")) * 3600) + (VAL(GETWORDNUM(VEH.EvtTime, 2, ":")) * 60) + (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]] ) DT 
	WHERE DT.start_time <= {[[ttEndTime]]} AND DT.end_time >= {[[ttStartTime]]}
ENDTEXT 
Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform