Microsoft
Software
Hardware
Network
Question : Access 2007 - Query - String Manipulation - I need to cut delete the first two Characters in a Field based on criteria
I have a table with 9 Fields, with 100.000 individual records. in Field 5 I have PartNumbers that I have imported from another application, but for some strange reason the Import Process added either a character "1" and an empty space or an "0" and an empty space before some of them (5000 records affected).
I have tried to create multiple update queries but i get the Len/Trim/ Functions wrong.....so i am begging the "EE-Force" for help ;-)
A correct entry looks like this > 1Q9 999 999 XX XXX (numbers and letters mixed with spaces, always the same construction of 3 char, one space, 3 char, one space....the first character could be a number from 1-9
The wrong code looks like this > 1 1Q9 999 999 XX XXX > The first position now has an additional "1" (or in some cases a "0") character.
I think my problem is because i have to delete the "1 " but keep the following "1"
Can this be done with a Query in Query Design or do I need to use VBA code to clean-up the 5000 records???
Thanks in advance for your thoughts.
MC
Answer : Access 2007 - Query - String Manipulation - I need to cut delete the first two Characters in a Field based on criteria
Correction
Does This do it:-
UPDATE Table1 SET PartNumber = Right(PartNumber, Len(PartNumber) - 2)
WHERE Left(PartNumber, 2) = "1 " OR Left(PartNumber, 2) = "0 "
DJ
Random Solutions
windows 7 remote desktop
Windows SBS 2008 Freezing...
SQL needs to ignore input mask
TRYING TO OPEN ACCESS DATABASE THAT HAS A FRONT END MENU WHEN DOUBLE CLICK TO OPEN
Entourage 2008 users can no longer login/sync to Exchange 2007
On Insert: The text, ntext, or image data type cannot be selected as DISTINCT
Cached domain credentials in Administrator account of Workgroup computer.
Network driver for Acer one - Model za3 ------ ao751h (Intel atom 1.3 Ghz)
ReOrder Priorirty
ORDER BY in UNION query that contains both text and numbers