hi
I have 2 tables that are,
Create table products (idproduct int, nameproduct varchar(80), primary key (idproduct))
Create table use(product int, dateuse date, primary key(dateuse,product))
what i want to do is, a select that show if a product was uses in that day, and if was, show a 1 ou X, if not dont show anything, and in the last collum show the sum.
the date can be for a week, 2008/1/1, 2008/1/2, 2008/1/3, 2008/1/4, 2008/1/5, 2008/1/6, 2008/1/7.
what i wanna do is like this.
Prod|2008/1/1|2008/1/2|2008/1/2|2008/1/3|2008/1/3| SUM|
---------------------------------------------------------------------------|
1|______|X|X|____| X|3|
2|___|X|X|____| X|3|
3|X|_____|____|___| X|2|
4|X|_____|X|X| X|4|
5|____|X|X|____| X|3|
6|X|_____|____|___| X|2|
7|___|X__|X|X| X|4|
8|X|X_|X|____| X|4|
hope you can help me
cya