Hi
I have a view that I am using to export information. Some of the information we do not hold in any tables and the result would always be the same.
So we have Delivery or Collection, I always want it to be D.
We also have Breakable and the result will always be 0
How do I add an alias in a view that it will always populate the result set with D and 0 in the respective alias columns. This is the code form SQL as the view looks now.
Thanks
SELECT dbo.Customer.CustomerCode, dbo.Customer.Name, dbo.CustomerAddress.Address1, dbo.CustomerAddress.Address2, dbo.CustomerAddress.Address3,
dbo.CustomerAddress.City, dbo.CustomerAddress.County, dbo.JourneySODetail.DeliveryPostCode, dbo.DeliveryArea.Name AS [Cust.text03],
dbo.Customer.CustomerCode AS [Call.ID], dbo.JourneySODetail.TotalVolume, dbo.JourneySODetail.TotalWeight, db
rderHeader.DateRequired,
db
rderHeader.CustomerRef, db
rderHeader.HeaderNotes
FROM db
rderHeader INNER JOIN
dbo.CustomerAddress ON db
rderHeader.DeliveryAddressID = dbo.CustomerAddress.CustomerAddressID INNER JOIN
dbo.JourneyHeader ON db
rderHeader.JourneyID = dbo.JourneyHeader.JourneyID INNER JOIN
dbo.Customer ON db
rderHeader.CustomerID = dbo.Customer.CustomerID INNER JOIN
dbo.DeliveryArea ON db
rderHeader.DeliveryAreaID = dbo.DeliveryArea.DeliveryAreaID INNER JOIN
dbo.JourneySODetail ON db
rderHeader.OrderID = dbo.JourneySODetail.OrderID
I have a view that I am using to export information. Some of the information we do not hold in any tables and the result would always be the same.
So we have Delivery or Collection, I always want it to be D.
We also have Breakable and the result will always be 0
How do I add an alias in a view that it will always populate the result set with D and 0 in the respective alias columns. This is the code form SQL as the view looks now.
Thanks
SELECT dbo.Customer.CustomerCode, dbo.Customer.Name, dbo.CustomerAddress.Address1, dbo.CustomerAddress.Address2, dbo.CustomerAddress.Address3,
dbo.CustomerAddress.City, dbo.CustomerAddress.County, dbo.JourneySODetail.DeliveryPostCode, dbo.DeliveryArea.Name AS [Cust.text03],
dbo.Customer.CustomerCode AS [Call.ID], dbo.JourneySODetail.TotalVolume, dbo.JourneySODetail.TotalWeight, db
db
FROM db
dbo.CustomerAddress ON db
dbo.JourneyHeader ON db
dbo.Customer ON db
dbo.DeliveryArea ON db
dbo.JourneySODetail ON db