Rabu, 19 Agustus 2015

RE: [MS_AccessPros] changing how data is stored

 

thank you both very much, this will be extremely helpful

really appreciate the assistance

Patty



---In MS_Access_Professionals@yahoogroups.com, <graham@...> wrote :

Hi Patty

 

To add to John's excellent advice, if you are adding brackets then you probably do not want to add them if they are already there – therefore add a WHERE clause to your UPDATE query:

 

UPDATE MyTable

SET Person_ID = 

"{" & [Person_ID] & "}"
WHERE Left([Person_ID], 1) <> "{";

 

Best wishes,

Graham

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Wednesday, 19 August 2015 21:29
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] changing how data is stored

 

 

Patty-

 

To remove the brackets from Person_ID in the records that have them, do this:

 

UPDATE MyTable

SET Person_ID = 

Replace(Replace([Person_ID], "{", ""), "}", "");

 

To add brackets to Person_ID in the records that do not have them, do this:

 

UPDATE MyTable

SET Person_ID = 

"{" & [Person_ID] & "}";

 

John Viescas, Author

Microsoft Access 2010 Inside Out

Microsoft Access 2007 Inside Out

Microsoft Access 2003 Inside Out

Building Microsoft Access Applications 

SQL Queries for Mere Mortals 

(Paris, France)

 

 

 

On Aug 19, 2015, at 2:36 AM, pattykf@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

 

I have  a table that was created by an electronic health record company. for some reason they did not include the {  } symbols around the patient ID, as they have in other tables. I am unable to match up the patients due to these missing symbols.  How can I add it back into a table (or a query from that table where I convert the person ID to include the symbols?

thank you so much

Patty

 

example:

Person_ID  E8D2E-C4B1-45C6-BE84 on the table with error

and for the other tables with this information:

{E8D2E-C4B1-45C6-BE84}

 

 

 

__._,_.___

Posted by: pattykf@cox.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

.

__,_._,___

Tidak ada komentar:

Posting Komentar