Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Convert this basic Jet SQL statement to T-SQL

Author  Topic 

kamikaze
Starting Member

8 Posts

Posted - 2010-03-10 : 08:40:05

SELECT tblJobDetails.*, OwnedVehicle.CO2 AS VCO2, ([EndMileage]-[StartMileage]*([VCO2])) AS tot1, tblPostcodes.x AS xPosd, tblPostcodes.y AS yPosd
FROM tblStatus INNER JOIN (tblPostcodes INNER JOIN (tblJobDetails LEFT JOIN OwnedVehicle ON tblJobDetails.VehicleID = OwnedVehicle.VehicleID) ON tblPostcodes.PostcodeID = tblJobDetails.PostcodeID) ON tblStatus.StatusID = tblJobDetails.StatusID;


can anybody convert this JET SQL statement to T-SQL? the problem lies when i call VCO2 in my calulation. Since this is an expression from a previuos line in the same query. how do i go about making this work and retain my expression collumn.

ummm...

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-10 : 09:35:52
I have already answered here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141143

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -