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]._4ee4d7af5057436eb8a4233a91c9c5da [PurchasedProduct_Id],
[PurchasedProduct]._57ab9384ec7f4934855f519731d93974 [PurchasedProduct_Name],
[PurchasedProduct]._74d26be8b4a1486f8e1a173c5e6345f7 _c28df53a5608e0d867c890c2dcf09013,
[PurchasedProduct]._07136e849b094edb8311826f39290515 _067e0a85464f34018e03f5c5f1c4fd49,
[PurchasedProduct]._0127369154bb4efeb2f540c0fdce21d6 [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
_70f072aa5c75444d95668f3d11abd4cc.[Id] _4ee4d7af5057436eb8a4233a91c9c5da,
_70f072aa5c75444d95668f3d11abd4cc.[Name] _57ab9384ec7f4934855f519731d93974,
_1bd3b8d9f58e4ef398783864710b160b.[From] _74d26be8b4a1486f8e1a173c5e6345f7,
ISNULL(_1bd3b8d9f58e4ef398783864710b160b.[UpTo], '3000-01-01 00:00:00.000') _07136e849b094edb8311826f39290515,
_1bd3b8d9f58e4ef398783864710b160b.[Price] _0127369154bb4efeb2f540c0fdce21d6
FROM [Product] _70f072aa5c75444d95668f3d11abd4cc
INNER JOIN [ProductPriceHistory] _1bd3b8d9f58e4ef398783864710b160b ON (_70f072aa5c75444d95668f3d11abd4cc.[Id] = _1bd3b8d9f58e4ef398783864710b160b.[ProductId])
) [PurchasedProduct] ON
(
([Purchase].[ProductId] = [PurchasedProduct]._4ee4d7af5057436eb8a4233a91c9c5da)
AND
([PurchasedProduct]._74d26be8b4a1486f8e1a173c5e6345f7 <= [Purchase].[Date])
AND
([PurchasedProduct]._07136e849b094edb8311826f39290515 > [Purchase].[Date])
)
LEFT JOIN [Address] [PurchaseDeliveryAddress] ON ([Purchase].[DeliveryAddressId] = [PurchaseDeliveryAddress].[Id])