July 15, 2009 at 9:33 am
I'm not sure if what I'm looking to is possible, but here goes - I'm wanting to do is calculate activity between sales dates. Suppose I have a table that records car sales and I record 5 this month and I add 60 customers to our customer table this month is it possible cacultate the number of customers added between each sale???
July 15, 2009 at 9:43 am
Hi there,
Any chance you could post table structures with some sample data and your expected results?
Here is a very useful article on how to post this information: http://www.sqlservercentral.com/articles/Best+Practices/61537/
///edited typo
July 15, 2009 at 10:11 am
You may have Customer_Created_Date in Customer table. And you have Sales_Date in Sales Table.
You can use
SELECT COUNT(Customer_ID) FROM Customer
WHERE Customer_Created_Date BETWEEN Sales_Date_1 AND Sales_Date_2
For Sales_Date_1 and 2, you can use nested query or view.
July 19, 2009 at 7:29 pm
ekla_pathik (7/15/2009)
You may have Customer_Created_Date in Customer table. And you have Sales_Date in Sales Table.You can use
SELECT COUNT(Customer_ID) FROM Customer
WHERE Customer_Created_Date BETWEEN Sales_Date_1 AND Sales_Date_2
For Sales_Date_1 and 2, you can use nested query or view.
NO. Absolutely NOT. BETWEEN includes both items.
dcarpenter... are you all set on this or do you still need some help?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply