Report Generator Demo
This is where you can play around with the hierarchical report generator by supplying a where clause in plain text and (de)selecting columns of the various lists (4 tables and a subselect) involved.
For a tutorial on how to construct expressions and what the extra options in this demo are click here.
For an overview of the content in all the base tables used in this hierarchical report click here.
The small window you are using greatly diminishes your demo experience. Please consider viewing using a larger window.
Command Text:
SELECT
[Customer].[Id] [Customer_Id],
[Customer].[FirstName] [Customer_FirstName],
[Customer].[LastName] [Customer_LastName],
[Customer].[DateOfBirth] [Customer_DateOfBirth],
[Customer].[IsPreferred] [Customer_IsPreferred],
[Customer].[HomeAddressId] [Customer_HomeAddressId],
[Customer].[BillingAddressId] [Customer_BillingAddressId],
[CustomerHomeAddress].[Id] [CustomerHomeAddress_Id],
[CustomerHomeAddress].[City] [CustomerHomeAddress_City],
[CustomerHomeAddress].[ZipCode] [CustomerHomeAddress_ZipCode],
[CustomerHomeAddress].[Street] [CustomerHomeAddress_Street],
[CustomerHomeAddress].[HouseNumber] [CustomerHomeAddress_HouseNumber],
[CustomerHomeAddress].[HouseNumberAddition] [CustomerHomeAddress_HouseNumberAddition],
[CustomerBillingAddress].[Id] [CustomerBillingAddress_Id],
[CustomerBillingAddress].[City] [CustomerBillingAddress_City],
[CustomerBillingAddress].[ZipCode] [CustomerBillingAddress_ZipCode],
[CustomerBillingAddress].[Street] [CustomerBillingAddress_Street],
[CustomerBillingAddress].[HouseNumber] [CustomerBillingAddress_HouseNumber],
[CustomerBillingAddress].[HouseNumberAddition] [CustomerBillingAddress_HouseNumberAddition],
[Purchase].[Id] [Purchase_Id],
[Purchase].[CustomerId] [Purchase_CustomerId],
[Purchase].[ProductId] [Purchase_ProductId],
[Purchase].[Quantity] [Purchase_Quantity],
[Purchase].[Date] [Purchase_Date],
[Purchase].[DeliveryAddressId] [Purchase_DeliveryAddressId],
[PurchasedProduct]._95d34c57796040b390cd47725a55dfd3 [PurchasedProduct_Id],
[PurchasedProduct]._c00fbc24c8fc49e995b86775696ae644 [PurchasedProduct_Name],
[PurchasedProduct]._748457dbd2884d3b970886d30a2cbb68 _4ed971aabdf7fea85d217ebf31d3c7e9,
[PurchasedProduct]._dc2a952e01a94435a8827a7494c7f18d _78226ce69a6994ead316726a37f7a3e1,
[PurchasedProduct]._b1da9d4f1dc84f499be050729038427a [PurchasedProduct_Price],
[PurchaseDeliveryAddress].[Id] [PurchaseDeliveryAddress_Id],
[PurchaseDeliveryAddress].[City] [PurchaseDeliveryAddress_City],
[PurchaseDeliveryAddress].[ZipCode] [PurchaseDeliveryAddress_ZipCode],
[PurchaseDeliveryAddress].[Street] [PurchaseDeliveryAddress_Street],
[PurchaseDeliveryAddress].[HouseNumber] [PurchaseDeliveryAddress_HouseNumber],
[PurchaseDeliveryAddress].[HouseNumberAddition] [PurchaseDeliveryAddress_HouseNumberAddition]
FROM [Customer] [Customer]
LEFT JOIN [Address] [CustomerHomeAddress] ON ([Customer].[HomeAddressId] = [CustomerHomeAddress].[Id])
LEFT JOIN [Address] [CustomerBillingAddress] ON ([Customer].[BillingAddressId] = [CustomerBillingAddress].[Id])
LEFT JOIN [Purchase] [Purchase] ON ([Customer].[Id] = [Purchase].[CustomerId])
LEFT JOIN
(
SELECT
_d1f92dc171024af8b41ae9960dc2a382.[Id] _95d34c57796040b390cd47725a55dfd3,
_d1f92dc171024af8b41ae9960dc2a382.[Name] _c00fbc24c8fc49e995b86775696ae644,
_f9a526a7b1d14406a186f4340ae902bf.[From] _748457dbd2884d3b970886d30a2cbb68,
ISNULL(_f9a526a7b1d14406a186f4340ae902bf.[UpTo], '3000-01-01 00:00:00.000') _dc2a952e01a94435a8827a7494c7f18d,
_f9a526a7b1d14406a186f4340ae902bf.[Price] _b1da9d4f1dc84f499be050729038427a
FROM [Product] _d1f92dc171024af8b41ae9960dc2a382
INNER JOIN [ProductPriceHistory] _f9a526a7b1d14406a186f4340ae902bf ON (_d1f92dc171024af8b41ae9960dc2a382.[Id] = _f9a526a7b1d14406a186f4340ae902bf.[ProductId])
) [PurchasedProduct] ON
(
([Purchase].[ProductId] = [PurchasedProduct]._95d34c57796040b390cd47725a55dfd3)
AND
([PurchasedProduct]._748457dbd2884d3b970886d30a2cbb68 <= [Purchase].[Date])
AND
([PurchasedProduct]._dc2a952e01a94435a8827a7494c7f18d > [Purchase].[Date])
)
LEFT JOIN [Address] [PurchaseDeliveryAddress] ON ([Purchase].[DeliveryAddressId] = [PurchaseDeliveryAddress].[Id])