User Profile

Collapse

Profile Sidebar

Collapse
Pendragon
Pendragon
Last Activity: Mar 15 '10, 08:40 AM
Joined: Feb 22 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Pendragon
    replied to SQL SUM HAVING Problem
    Thanks for helping me produce the query that was originally required. I've been asked to tweak the report by itemising calls by username, for all users who have made telephone calls totalling over 15.00, rather than producing a report grouping and totalling the cost by username. I thought it was a simple case of removing the 'GROUP BY' line or removing 'SUM' from the select line, but different combinations aren't getting me anywhere and I'm a bit...
    See more | Go to post

    Leave a comment:


  • Pendragon
    replied to SQL SUM HAVING Problem
    Thanks for the link ck9663, it's definitely been of help.
    See more | Go to post

    Leave a comment:


  • Pendragon
    replied to SQL SUM HAVING Problem
    I'm actually using SQL Server 2005, which from what I've read has got better email functionality than previous versions of SQL.

    Sorry I've been posting in the wrong forum. Doing a quick search I saw a few SQL questions posted in this Access forum and assumed this was the forum for such posts. I didn't see a SQL forum. Thanks for not flaming me, as I know some sites can be quite militant about such things.
    See more | Go to post

    Leave a comment:


  • Pendragon
    replied to SQL SUM HAVING Problem
    Thanks for your help guys. That worked a treat. Just need to do some research on how to automate the creation of that report and email it to a user every week. I was thinking of something along the lines of creating a text .sql osql file, a scheduled task and using our own SMTP utility. However it might be easier creating a SQL job and I think SQL has its own in-built email function from a quick search of Help. Just don't have the permissions to...
    See more | Go to post

    Leave a comment:


  • Pendragon
    started a topic SQL SUM HAVING Problem

    SQL SUM HAVING Problem

    Hi,

    I'm trying to write a query, which produces a list of users, whose telephone call costs total over 15.00 for the month, but I'm having difficulty. Here's my query;

    Code:
    SELECT     userid, username, SUM(netamt)
    FROM         EMNCommon
    HAVING      (SUM(netamt) >= '15.0000') AND (transdate > GETDATE() - 30)
    GROUP BY username
    I've tried a few different variations of this, but I'm not...
    See more | Go to post
No activity results to display
Show More
Working...