Add two Address fields together and put into one.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hulm1
    New Member
    • Mar 2008
    • 22

    Add two Address fields together and put into one.

    I need to take two fields (Addess_1 and Address_2) and put them into one (address) in an existing database. I imagine I should use an Update Query but am making a bit of a dog's breakfast of it.

    Also: Ironically, I need to take a Single field (Contact Name) and split it into two (First Name and Last Name). Again I suspect an update query.

    Can someone please advise? Thanks
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Originally posted by Hulm1
    put them into one (address) in an existing database
    Your post could be a little clearer. If by this you mean within the same database they're already in, what you need to do (if you're not already doing it) is base your forms/reports off of queries based on your table(s) which you should do routinely anyway. Then, in Design View for your query, create a calculated field like this:

    CompleteAddress : [Addess_1] & " " & [Address_2]

    Now, in your forms/reports, simply use the created field CompleteAddress, like you would any other field. That's all you'll need to do, no Update Query needed.

    Parsing the whole name into last name/ first name will require a little more effort, depending on the current format of this field. We need to see how it's currently formatted, i.e.

    John Smith
    Smith, John
    Smith John

    and whether the names have Mr/Mrs/Ms before as well as Jr/Sr/III and so forth afterwards. Obviously, the more complications beyond the simple first name and last name, the more difficult/less successful efforts will be to parse the names without human intervention.

    Linq ;0)>

    Comment

    • Hulm1
      New Member
      • Mar 2008
      • 22

      #3
      Thank you for the reply.

      Regarding addresses first: This is all one database that I have been building. I have been learning as I go.

      Consequently I find that I have not done things according to best practice. I accept your approach re: calculated fields, but I think that this is not really what I want. The reason is that I am quite keen on the idea of lnterfacing my database with MS Outlook and that uses one address field. As such, I really would prefer some kind of update query to convert my current database to this format and go forward from there.

      Regarding the names: The same applies. In this case, however, I only want to make the change now, before I regret it later! I currently do NOT include title of any kind, nor punctuation. Just first and last name. Currently it is simply: John Smith

      Comment

      • Hulm1
        New Member
        • Mar 2008
        • 22

        #4
        I have solved both if these issues now

        Thank you

        Comment

        • missinglinq
          Recognized Expert Specialist
          • Nov 2006
          • 3533

          #5
          Glad you've got it all running!

          Linq ;0)>

          Comment

          Working...