Microsoft
Software
Hardware
Network
Question : Access TRIM Field Name
In the attached sample, please find a tab for "Name_First" and a tab for "Name_Last." Our data processing system adds spaces to these fields (I have found the Name_First to have more nuances in format), that later do not facilitate easy data manipulation.
I can use the following Excel formula to trim any "hidden" spaces, as well as trim the names to include only the first character string.
LEFT(TRIM(A2),MIN(FIND({" ","-"},TRIM(A2)&" -"))-1)
That is:
Name_First
William John becomes William
William J becomes William
Name_Last
John Jr becomes John
John-Bently becomes John
Please offer a SQL code in Access (2003) that will:
1. Trim an unseen characters (speces, zeroes, etc)
2. Trim the name so that only the first set string appears
Thanks
Answer : Access TRIM Field Name
SELECT Trim(IIf(InStr(Trim([Name_
First])," ")>0,Left(Trim([Name_First]
),InStr(Tr
im([Name_F
irst])," ")-1),IIf(InStr(trim([Name
_First]),"
-")>0, Left(trim([Name_First]),In
Str(Trim([
Name_First
]),"-")-1)
,[Name_Fir
st]))) AS Expr1, *
FROM B;
Random Solutions
Need example code to programmatically pin a folder to make it "Always Available Offline"
FILE RENAME IN FOXPRO
validating parameters in batch file
sql to copy data from table 1 to table 2 in sep databases
Excel: how can i obtain the cross product of concatenating two columns
can disc stuck at stage 2 of 3
Get table name from column in a view
How to recover moved files and deleted files from Windows machine
SharePoint: Error Moving File or Folder Cannot Read from Source File or Disk
how to keep the session variable alive until the user close the browser?