Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Need help w/ an SQL statement

  1. #1
    StorageSolutions is offline Member
    Join Date
    Jun 2007
    Location
    Vero Beach, Florida
    Posts
    66

    Default Need help w/ an SQL statement

    I'm using the following sql statement to get a count on our business from repeat customers and would like to be able to specify a time frame (ie 3/01/10 - 3/31/10) but have been unsuccessful. What do I need to add to this?

    SELECT Email,
    COUNT(Email) AS NumOccurrences
    FROM Orders
    GROUP BY Email
    HAVING ( COUNT(Email) > 1 )

    Thanks in advance for your assistance!
    David
    ML 8.0.1.2

  2. #2
    John Reasons is offline Senior Member
    Join Date
    Oct 2009
    Posts
    119

    Default

    I was able to accomplish by doing something like:

    Code:
    SELECT Email,
    COUNT(Email) AS NumOccurrences
    FROM Demo.dbo.Orders
    Where AuthorizedOn BETWEEN '3/01/10' and '3/31/10'
    GROUP BY Email
    HAVING ( COUNT(Email) > 1 )