Friday, February 24, 2012

Help with Where

I help with my where statment, I need the Asset ID to return all valuse that are matching with the ESN Number or ID.

SELECT Asset.AssetId,
A.Description,
B.Barcode,
C.AssetDescription,
B.SKU,
J.EsnNumber,
G.WarehouseDescription,
I.TraceTime,
I.PreviousTraceTime,
I.HasMoved,
I.DistanceMiles,
I.Direction,
I.Landmark,
I.FemaLocation,
I.ReportTime,
I.ReplaceByDate,
I.CurrLocStreet,
I.CurrLocCity,
I.CurrLocState,
I.CurrLocZip,
I.CurrLocCounty,
I.CurrMileFromStratix,
I.PrevMileFromStratix
FROM AssetType As A
INNER JOIN Asset As B ON (A.AssetTypeId = B.AssetTypeId)
INNER JOIN AssetAttribute As C ON (A.AssetTypeId = C.AssetTypeId AND B.AssetAttributeId = C.AssetAttributeId)
INNER JOIN AssetVehicle As D ON (B.AssetId = D.AssetId)
INNER JOIN AssetCustomAttribute As E ON (B.AssetId = E.AssetId)
INNER JOIN AssetCustomAttributeDef As F ON (A.AssetTypeId = F.AssetTypeId AND E.AssetCustomAttributeDefId = F.AssetCustomAttributeDefId AND E.AssetTypeId = F.AssetTypeId)
INNER JOIN InventoryOrigin As G ON (B.WarehouseId = G.WarehouseId)
INNER JOIN EsnAsset As H ON (B.AssetId = H.AssetId)
INNER JOIN ESNTracking As I On (H.EsnID = I.EsnID)
INNER JOIN ESN As J ON (I.EsnId = J.EsnId)
WHERE B.AssetId = 'EsnNumber'

Hi,

I guess this is not enough information to help you, could you explain that in more detail ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

No comments:

Post a Comment