Viewing 5 posts - 1 through 5 (of 5 total)
Try this
WITH cte AS
(
SELECT machine_id,
CASE WHEN DATEDIFF('m', firstseen, getdate()) = 0 THEN 'AUG'
...
September 14, 2012 at 6:57 am
This query will not give correct output in this case
create TABLE t1 (ID INT, Date DATETIME, [User] VARCHAR(10), Action VARCHAR(10))
INSERT INTO t1
SELECT 22, '8/16/2012 12:10:36', 'A', 'Something'
UNION ALL SELECT 2,...
September 14, 2012 at 6:47 am
Change your query to look like this
select inv_number, round(SUM(l.line_units * p.p_price), 2) as "Invoice Total"
from line l
join product p
on l.p_code = p.p_code
group by inv_number
January 23, 2012 at 12:26 pm
Change your query to look like this.
select inv_number, round(SUM(l.line_units * p.p_price), 2) as "Invoice Total"
from line l
join product p
on l.p_code = p.p_code
group by inv_number;
January 23, 2012 at 12:25 pm
Try this query. It will work.
SELECT f.ForumId,f.Title,f.Intro,count(t.ThreadId) AS [Thread Count],count(p.PostId) AS [Post Count] FROM
Forum f inner join Thread t on f.ForumID = t.ForumID
inner join Post p on t.ThreadId...
January 23, 2012 at 12:10 pm
Viewing 5 posts - 1 through 5 (of 5 total)