August 1, 2008 at 6:24 am
Will this query pull out records where the card has been used more than once with the date range, one or more different orders?
August 1, 2008 at 6:30 am
That's the intention.
If you're likely to have a run of questions on this topic, why not post some table structures and sample data for people to test against?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
August 1, 2008 at 6:48 am
I will just that to share the knowledge
August 1, 2008 at 8:56 am
Here is the table structure:
CREATE TABLE [dbo].[T_Payments](
[OrderID] [int] NOT NULL,
[CCNumber] [nvarchar](1024) NULL,
GO
CREATE TABLE [dbo].[OrderHeader](
[OrderID] [int] NOT NULL,
[CustomerID] [int] NULL,
[ShipSurname] [nvarchar](50) NULL,
[ShipForename] [nvarchar](50) NULL,
[ShipTitle] [nvarchar](20) NULL,
[ShipAdd1] [nvarchar](50) NULL,
[ShipPostcode] [nvarchar](50) NULL,
[OrderDate] [datetime] NULL,
[OrderTotal] [money] NULL,
Viewing 4 posts - 16 through 18 (of 18 total)
You must be logged in to reply to this topic. Login to reply