fullmoon2
Technical User
- Aug 14, 2005
- 20
Hi
I have a little problem I hope someone can help me solve:
I'm going to count from one date to another, like from 2011-01-01 to today.
And I'm going to put it into a view:
CREATE VIEW VWtotalsale
AS
SELECT sales.title_id, sales.qty, titles.price, sales.ord_date
FROM sales INNER JOIN titles ON sales.title_id = titles.title_id
SELECT SUM(qty * price) AS totalsale FROM VWtotalsale
(finds the totalsale for the whole table)
and add the totalsale from 2011-01-01 to today..
Anyone that have an idea?
Thanks in advance
I have a little problem I hope someone can help me solve:
I'm going to count from one date to another, like from 2011-01-01 to today.
And I'm going to put it into a view:
CREATE VIEW VWtotalsale
AS
SELECT sales.title_id, sales.qty, titles.price, sales.ord_date
FROM sales INNER JOIN titles ON sales.title_id = titles.title_id
SELECT SUM(qty * price) AS totalsale FROM VWtotalsale
(finds the totalsale for the whole table)
and add the totalsale from 2011-01-01 to today..
Anyone that have an idea?
Thanks in advance