Forum Replies Created

Viewing 15 posts - 121 through 135 (of 541 total)

  • RE: Display single row

    John Mitchell-245523 (8/12/2014)


    Use ROW_NUMBER() over that first column, and just select the one where the row number is 1.

    John

    Thanks John,

    The problem is how do I differentiate between NATBX7686 and NATBX7686A...

  • RE: Display single row

    Luis Cazares (8/12/2014)


    Or maybe you could filter the columns with a condition. I'm not sure if it'll be better.

    SELECT column1,

    column2,

    column3,

    ...

  • RE: Display single row

    pwalter83 (8/12/2014)


    Hi,

    I have requirement to display only a single unique row out of the 2 rows. In the attached screenshot for example NATBX7686 and NATBX7686A shows twice but container number...

  • RE: Display ALL rows even if no data exists

    ChrisM@Work (8/7/2014)


    I don't see any parameters in your code, Paul.

    Any ideas, Chris ??

  • RE: Display ALL rows even if no data exists

    LutzM (8/7/2014)


    Like I said before: Step 1 is to get the query you're looking for without the additional countries that aren't included in the result set.

    Please post that query.

    Sorry Lutz,...

  • RE: Display ALL rows even if no data exists

    ChrisM@Work (8/7/2014)


    I don't see any parameters in your code, Paul.

    Sorry Chris, the code should be as attached. I am making blunders after blunders. This is what happens when you have...

  • RE: Display ALL rows even if no data exists

    ChrisM@Work (8/7/2014)


    pwalter83 (8/7/2014)


    ChrisM@Work (8/7/2014)


    This should get you started with Jeff's suggestion:

    SELECT *

    INTO #Offices

    FROM (VALUES

    ('KBE ANR','BELGIUM'),('KBE ZEE','BELGIUM'),('KEU ANR','BELGIUM'),

    ('KDE VIE','AUSTRIA'),

    ('KDE BRE','GERMANY'),('KDE BRV','GERMANY'),('KDE DUS','GERMANY'),('KDE FRA','GERMANY'),('KDE HAM','GERMANY'),('KDE MUC','GERMANY'),('KDE STR','GERMANY'),

    ('KFR BOD','FRANCE'),('KFR DKK','FRANCE'),('KFR FOS','FRANCE'),('KFR...

  • RE: Display ALL rows even if no data exists

    ChrisM@Work (8/7/2014)


    This should get you started with Jeff's suggestion:

    SELECT *

    INTO #Offices

    FROM (VALUES

    ('KBE ANR','BELGIUM'),('KBE ZEE','BELGIUM'),('KEU ANR','BELGIUM'),

    ('KDE VIE','AUSTRIA'),

    ('KDE BRE','GERMANY'),('KDE BRV','GERMANY'),('KDE DUS','GERMANY'),('KDE FRA','GERMANY'),('KDE HAM','GERMANY'),('KDE MUC','GERMANY'),('KDE STR','GERMANY'),

    ('KFR BOD','FRANCE'),('KFR DKK','FRANCE'),('KFR FOS','FRANCE'),('KFR LEH','FRANCE'),('KFR LIO','FRANCE'),('KFR...

  • RE: Display ALL rows even if no data exists

    LutzM (8/7/2014)


    I would use the following approach:

    WITH cte_with_values AS

    (

    SELECT xxx

    FROM abc INNER JOIN cde ON abc.col1=cde.col1

    )

    SELECT your_columns

    FROM tbl_with_list_of_countries t

    LEFT OUTER JOIN cte ON t.country=cte.country

    The verbal description:

    Within the cte calculate the...

  • RE: Display row even if data is null

    ChrisM@Work (7/7/2014)


    SELECT mc.COUNTRY_DSC, alias.POL_LOCATION_CD, alias.TEU, mcc.TYPE_CD

    FROM MG_COUNTRY mc

    LEFT JOIN (VALUES

    ('Germany'),('Austria'),('Netherlands'),('Belgium'),('France'),

    ('Ireland'),('Sweden'),('Finland'),('Denmark'),('Norway')

    ) d (COUNTRY_DSC)

    ON d.COUNTRY_DSC = mc.COUNTRY_DSC

    LEFT JOIN MG_OFFICE mo

    ON mo.COUNTRY_CD = mc.COUNTRY_CD

    LEFT JOIN MG_BOOKING_DATASET mgd

    on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD

    AND alias.Booking_status_cd...

  • RE: Display row even if data is null

    ChrisM@Work (7/7/2014)


    SELECT d.COUNTRY_DSC, alias.POL_LOCATION_CD, alias.TEU, mcc.TYPE_CD

    FROM (VALUES

    ('Germany'),('Austria'),('Netherlands'),('Belgium'),('France'),

    ('Ireland'),('Sweden'),('Finland'),('Denmark'),('Norway')

    ) d (COUNTRY_DSC)

    LEFT JOIN MG_COUNTRY mc

    ON mc.COUNTRY_DSC = d.COUNTRY_DSC

    LEFT JOIN MG_OFFICE mo

    ON mo.COUNTRY_CD = mc.COUNTRY_CD

    LEFT JOIN MG_BOOKING_DATASET mgd

    on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD

    AND alias.Booking_status_cd...

  • RE: Display row even if data is null

    ChrisM@Work (7/7/2014)


    SELECT alias.COUNTRY_DSC, alias.POL_LOCATION_CD, alias.TEU, mcc.TYPE_CD

    FROM MG_COUNTRY mc

    LEFT join MG_OFFICE mo

    ON mo.COUNTRY_CD = mc.COUNTRY_CD

    LEFT JOIN MG_BOOKING_DATASET mgd

    on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD

    AND alias.Booking_status_cd in ('H','F','I','P')

    LEFT join MG_BOOKING_EQUIPMENT_REQ ber

    on mgd.BOOKING_ID = ber.BOOKING_ID

    LEFT join...

  • RE: Multi-value parameter in SSRS shows blank

    Any help would be appreciated...

  • RE: Multi-value parameter in SSRS shows blank

    Hi,

    I need a code for a split function that can also handle double quotes in values along with the usual commas. Could anyone please help in this regard ?

    I need...

  • RE: Multi-value parameter in SSRS shows blank

    Jack Corbett (7/3/2014)


    Can you share the Split code?

    Have you verified that the split function is returning what you expect?

    When you pass in a single...

Viewing 15 posts - 121 through 135 (of 541 total)