Forum Replies Created

Viewing 14 posts - 1 through 15 (of 15 total)

  • RE: Help with basic query

    Thanks Sean and Luis. I imported the records from an excel file and sql server automatically defined the data type as float. As you guys suggested, I have now updated...

  • RE: SQL Join

    John Mitchell-245523 (9/27/2016)


    If you always have a space in the middle of your postcode, and you want to match everything to the left of the space, change your join predicate...

  • RE: Help with matching contacts to organisations

    I do understand that. Both tables have 'North Middlesex University Hospital NHS Trust' and 'N18 1QX' but when you join the tables and match on name and postcode it fails...

  • RE: Help with matching contacts to organisations

    Results based on exact match on the post code and org name.

  • RE: Help with matching contacts to organisations

    J Livingston SQL (9/23/2016)


    seems we are a bit confused between ourselves

    USE tempdb

    GO

    CREATE TABLE [dbo].[masterContacts](

    [Organisation Name] [nvarchar](255) NULL,

    [Office Address Line 1] [nvarchar](255) NULL,

    [Office Address Line 2] [nvarchar](255) NULL,

    [Office Address Line 3]...

  • RE: Help with matching contacts to organisations

    Thom A (9/23/2016)


    I might be missing something here, but masterContacts.[Mailing Address Line 1] contains no records that have the value N'North Middlesex University Hospital NHS Trust'. Your where clause is...

  • RE: Help with matching contacts to organisations

    J Livingston SQL (9/23/2016)


    this should be easy to help you...but the sample data isnt doing what you want.

    your sample data:

    USE tempdb

    GO

    CREATE TABLE [dbo].[masterContacts](

    [Organisation Name] [nvarchar](255) NULL,

    [Office Address Line 1] [nvarchar](255)...

  • RE: Help with matching contacts to organisations

    J Livingston SQL (9/23/2016)


    me thinks that part of your problem is that you are expecting an exact match on O.[Organisation Name] = M.[Mailing Address Line 1]

    what happens if you change

    inner...

  • RE: Help with matching contacts to organisations

    Thom A (9/23/2016)


    Would you mind pasting a link to where to data is located to on gov.uk (don't provide a link direct to the source, but the page which contains...

  • RE: Help with matching contacts to organisations

    I have provided the schema for tables and some dummy insert data.

    The problem is

    When i run a SELECT on masterContacts table by using a LIKE wild card I get...

  • RE: Help with matching contacts to organisations

    J Livingston SQL (9/23/2016)


    ok...thanks for data....didnt realise it was in public domain......nice to know that it is.

    looking at your dummy data....dont see that you have any data there that is...

  • RE: Help with matching contacts to organisations

    Data is available to use for anyone by UK government but I have removed the file anyway.

    Here are the schemas of two tables and some dummy data

    Schema:

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER...

  • RE: Help with matching contacts to organisations

    GilaMonster (9/23/2016)


    I strongly recommend you remove that file, as you are very likely in violation of the UK data privacy laws by posting personally identifying data in public.

    Post made up...

  • RE: Help with matching contacts to organisations

    J Livingston SQL (9/23/2016)


    are you sure you should have posted that information on a public forum?

    yes, all information is available to public on data.gov website. Thats where I have got...

Viewing 14 posts - 1 through 15 (of 15 total)