View Full Version : Crosstab Query modification


SomeCSian
12-28-2007, 06:04 AM
Hi all,

In Northwind DB i made a crosstab query which summarize no of categories that every customer buy his products from.

It works well in case of I summarizing all orders without any criteria.
If i set a criteria such as Order Date is greater than 1/1/1998, the form displays the customers who made orders in this interval only.
Now, How can i make it displays all customers and summarize the categories of customers who didn't make orders in this interval by zeros rather than deleting them.

llkhoutx
12-28-2007, 10:48 AM
Union query your data table/query with a query which generates all customers and a second union query which generates all products, then all customer and all products always appear.

SomeCSian
12-29-2007, 09:26 AM
Sorry, How can i union one table to crosstab query. Keep in mind that No. fields may differ.

llkhoutx
12-29-2007, 02:19 PM
Union a query or table which contains all crosstab column fields (each having null data) with the query or table used in the crosstab table, e.g. crosstab query a query, a union query to be specific.

Table 1
ID
Name
Region
Sales

Table 2
ID
Name
Region
Sales

Tbale 2 has all possible values of Region, Sales is null for all rows, Name can have the same value for each row. What you really want is all the Regions.

Alteratively, append null Sales for each Region to Table 1, before you generate the crosstab.

Draw a picture of it.