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]._abd9f1fa79c64e83827a5b552c2bf436 [PurchasedProduct_Id],
[PurchasedProduct]._f0ee997e89714f76af7e4471d124ee26 [PurchasedProduct_Name],
[PurchasedProduct]._ab698fe36fcd4f958e0b16f6b742f6d5 _4942a952322a47f1332189f4e3cdec1c,
[PurchasedProduct]._4832948f8810496584a435fb8566c1e0 _76ba20f48692025c810fd61d419820c9,
[PurchasedProduct]._429eeef1ec74460fa8fbd88057ee0d56 [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
_00ede5b1051a406a8312595881077a72.[Id] _abd9f1fa79c64e83827a5b552c2bf436,
_00ede5b1051a406a8312595881077a72.[Name] _f0ee997e89714f76af7e4471d124ee26,
_aff87e9ddbf54c568c73b30d303011f7.[From] _ab698fe36fcd4f958e0b16f6b742f6d5,
ISNULL(_aff87e9ddbf54c568c73b30d303011f7.[UpTo], '3000-01-01 00:00:00.000') _4832948f8810496584a435fb8566c1e0,
_aff87e9ddbf54c568c73b30d303011f7.[Price] _429eeef1ec74460fa8fbd88057ee0d56
FROM [Product] _00ede5b1051a406a8312595881077a72
INNER JOIN [ProductPriceHistory] _aff87e9ddbf54c568c73b30d303011f7 ON (_00ede5b1051a406a8312595881077a72.[Id] = _aff87e9ddbf54c568c73b30d303011f7.[ProductId])
) [PurchasedProduct] ON
(
([Purchase].[ProductId] = [PurchasedProduct]._abd9f1fa79c64e83827a5b552c2bf436)
AND
([PurchasedProduct]._ab698fe36fcd4f958e0b16f6b742f6d5 <= [Purchase].[Date])
AND
([PurchasedProduct]._4832948f8810496584a435fb8566c1e0 > [Purchase].[Date])
)
LEFT JOIN [Address] [PurchaseDeliveryAddress] ON ([Purchase].[DeliveryAddressId] = [PurchaseDeliveryAddress].[Id])