sql query not returning results

By: Jessica Daniel - jrdorbital
sql query not returning results
2003-01-29 07:41
The following sql query is returning an empty result set when executed. I have tried placing Begin and End statements around it since it is a compound query. The query will generate results in query analyzer. Are any bugs or limitations on how a sql query must be set up if it consists of more than one statement?


OrganizationName, VehicleName, VehicleSpeed, AirTemp, RoadTemp, EngineTemp, DrySandRate, SandWettingRate
INTO #aggregate
sde.OrbTrac_geoData data
JOIN sde.OrbTrac_VehicleGroupVehicle vgv ON data.VID=vgv.VehicleID
JOIN sde.OrbTrac_Vehicle v ON data.VID = v.VehicleID
JOIN sde.OrbTrac_Organization org ON v.OrgID = org.OrganizationID
( GeoTime BETWEEN '12/29/02 9:00 AM' AND '12/29/02 3:00 PM' )
AND vgv.VehicleGroupId = 'cbb3f58e-30c9-4c6e-90aa-7df7229f16c1'
SELECT OrganizationName, VehicleName, Avg(VehicleSpeed) as VehicleSpeed, Avg(AirTemp) as AirTemp, Avg(RoadTemp) as RoadTemp, Avg(EngineTemp) as EngineTemp, Avg(DrySandRate) as DrySandRate, Avg(SandWettingRate) as SandWettingRate
FROM #aggregate
GROUP BY VehicleName, OrganizationName
ORDER BY OrganizationName
DROP Table #aggregate

By: Chuck Deal - cdeal
RE: sql query not returning results
2003-01-29 08:31
You may want to stick that query inside a stored procedure. Then you can be sure that all of the complexity is handled properly (on the db server). Since it looks like you are just trying to return a single resultset, then your problem should clear up.
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet