Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. LFDavidson

    SQL Parsing/Update/Insert Query

    Thanks for all the help... That looks like its got it..
  2. LFDavidson

    SQL Parsing/Update/Insert Query

    select * FROM Contact Where [first] = 'GPS' And CharIndex(',', Contact_Point) > 0 Update Customer Set y_coordinate = Left(Contact_Point, CharIndex(',', Contact_Point) - 1), x_coordinate = LTrim(Right(Contact_Point, Len(Contact_Point)) - CharIndex(',', Contact_Point)) From Customer...
  3. LFDavidson

    SQL Parsing/Update/Insert Query

    One of those days... Yes, I need to update records that exist in the Customer table with the cooresponding record in the Contact table.... Sorry about that...
  4. LFDavidson

    SQL Parsing/Update/Insert Query

    Is a join not required?? INNER JOIN Contact ON Customer.Id = Contact.Customer_ID
  5. LFDavidson

    SQL Parsing/Update/Insert Query

    Basically, just ran it as you described above... Insert Into Customer(Id, y_coordinate, x_coordinate) Select Customer_ID, Left(Contact_Point, CharIndex(',', Contact_Point) - 1), LTrim(Right(Contact_Point, Len(Contact_Point)) - CharIndex(',', Contact_Point)) From Contact Where...
  6. LFDavidson

    SQL Parsing/Update/Insert Query

    Ran it but got the following error: Syntax error converting the varchar value '34.682938N,81.98757W' to a column of data type int
  7. LFDavidson

    SQL Parsing/Update/Insert Query

    Yes, the data should be fine. However, in double checking everything I see the concatenated data has the x and y coordinates reversed. Contact_point was entered as "latitude,longitude" whereas the standard convention is x coordinate is longitude and the y coordinate is latitude. Therefore...
  8. LFDavidson

    SQL Parsing/Update/Insert Query

    Its a large table with a lot of fields but the pertinent info for this is: x_coordinate datatype varchar y_coordinate datatype varchar
  9. LFDavidson

    SQL Parsing/Update/Insert Query

    Would a simple select with where clause as the first line work??
  10. LFDavidson

    SQL Parsing/Update/Insert Query

    Just noticed. It does need to select only records in Contact where the field 'First' has the code GPS only.. Records without the code GPS in 'First' would not be processed..
  11. LFDavidson

    SQL Parsing/Update/Insert Query

    Thanks for the help... MichaelF81, you are correct about the concatenated data is in the field 'Contact_Point' and then need to be split at the comman into the Customer table x and y fields... I will test this out on a test database...
  12. LFDavidson

    SQL Parsing/Update/Insert Query

    New to this site and new to learning SQL so hopefully this is an acceptable post: I have two tables in MSSQL, one that contains a field with concatenated data that I need to query and put the data into two separate fields in another table. Table - Contact I identify the correct records when...

Part and Inventory Search

Back
Top