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 2000 Forums
 SQL Server Development (2000)
 help with Query

Author  Topic 

danjapro
Starting Member

44 Posts

Posted - 2006-05-30 : 11:45:16
Here is my Query below, in SQL server as a view.
I am trying to return all the Assets with the correct information.

I need a where statment I dont know where to place it . I need all th Assets from Assets table to return all the following info

CODE::::::::::::::::

SELECT Asset.AssetId, AssetType.Description, Asset.Barcode, AssetAttribute.AssetDescription, Asset.SKU, ESN.EsnNumber,
InventoryOrigin.WarehouseDescription, ESNTracking.TraceTime, ESNTracking.PreviousTraceTime, ESNTracking.HasMoved,
ESNTracking.DistanceMiles, ESNTracking.Direction, ESNTracking.Landmark, ESNTracking.FemaLocation,
ESNTracking.ReportTime, ESNTracking.ReplaceByDate, ESNTracking.CurrLocStreet, ESNTracking.CurrLocCity,
ESNTracking.CurrLocState, ESNTracking.CurrLocZip, ESNTracking.CurrLocCounty, ESNTracking.CurrMileFromStratix,
ESNTracking.PrevMileFromStratix
FROM AssetType INNER JOIN
Asset ON AssetType.AssetTypeId = Asset.AssetTypeId INNER JOIN
AssetAttribute ON AssetType.AssetTypeId = AssetAttribute.AssetTypeId AND
Asset.AssetAttributeId = AssetAttribute.AssetAttributeId INNER JOIN
AssetVehicle ON Asset.AssetId = AssetVehicle.AssetId INNER JOIN
AssetCustomAttribute ON Asset.AssetId = AssetCustomAttribute.AssetId INNER JOIN
AssetCustomAttributeDef ON AssetType.AssetTypeId = AssetCustomAttributeDef.AssetTypeId AND
AssetCustomAttribute.AssetCustomAttributeDefId = AssetCustomAttributeDef.AssetCustomAttributeDefId AND
AssetCustomAttribute.AssetTypeId = AssetCustomAttributeDef.AssetTypeId INNER JOIN
InventoryOrigin ON Asset.WarehouseId = InventoryOrigin.WarehouseId INNER JOIN
EsnAsset ON Asset.AssetId = EsnAsset.AssetId INNER JOIN
ESNTracking INNER JOIN
ESN ON ESNTracking.EsnId = ESN.EsnId ON EsnAsset.EsnId = ESN.EsnId

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-05-30 : 16:07:21
Duplicate:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=66959

Please do not post the same question in multiple forums here.

Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -