Forum Replies Created

Viewing 15 posts - 91 through 105 (of 183 total)

  • RE: Matching recoreds

    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]...

  • RE: Matching recoreds

    I will just that to share the knowledge

  • RE: Matching recoreds

    Will this query pull out records where the card has been used more than once with the date range, one or more different orders?

  • RE: Matching recoreds

    Hello Chris

    What if I want to separate it: will it be like this?

    SELECT hr.OrderID, hr.OrderDate, p.CCNumber

    FROM T_OrderHeader h

    LEFT OUTER JOIN T_Payments

    ON (p.OrderID = h.OrderID d

    ...

  • RE: Matching recoreds

    Hi Chris

    The reason why I wanted the card number from the payment table is because the card number column in the customers table has no records

  • RE: Matching recoreds

    Built into it.

  • RE: Matching recoreds

    T_Payments has the card number column, while T_OrderHeader has the OrderDate column

  • RE: Date Display

    I later re-wrote the query and its something like this:

    SELECTDISTINCT

    CONVERT(VARCHAR(7), T_OrderHeader.OrderDate, 120) AS [YYYY-MM],

    CONVERT(VARCHAR(20),T_OrderHeader.OrderDate, 106) AS OrderDate,

    T_OrderHeader.OrderID,T_OrderHeader.CustomerID, T_OrderHeader.ShipTitle, T_OrderHeader.ShipForename, T_OrderHeader.ShipSurname,

    ...

  • RE: CSV File Extract

    Hi Guys

    This is an overview, of what is intended, maybe that will give you a logical view of the process.

  • RE: Date Display

    Hello Nigel

    Some my report doesn't display in the right format. I am using the following query:

    --LOST IN POST REPORT QUERY--

    SELECTRIGHT(CONVERT(VARCHAR(10), T_OH.OrderDate, 103), 7) AS [MM/YYYY],

    T_OH.OrderDate,

    T_OH.OrderID,CustomerID, T_OH.ShipTitle, T_OH.ShipForename, T_OH.ShipSurname,

    T_OH.OrderTotal,

    T_RR.ReasonID,...

  • RE: Matching recoreds

    Thanks Chris

    It worked and pulled out accurate results, was also wandering if it will be possible to pull out records of orders made by the same card within a 3...

  • RE: Matching recoreds

    FROM T_OrderHeader LEFT OUTER JOIN

    ...

  • RE: Matching recoreds

    The tables are linked by OrderID

  • RE: Group Row Count

    Thanks Guys

    Finally got to work, my group name within the expression wasn't the same when I checked the edit group section.

  • RE: Group Row Count

    This is the expression I used: ="Orders Cancelled: " + CountRows("CancelledBy").ToString

    I have also attached a screen shot of the table in BIDS.

Viewing 15 posts - 91 through 105 (of 183 total)