Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

Trim(Left( -- what if no spaces?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maria - 13 Jul 2006 00:36 GMT
I'm using the following which is working very well except it not working if
there are no spaces in the text of the field.  Can someone help?

MAILING_ADDRESS_2: Trim(Left([Mailing_Address2],InStr(1,[mAILING_aDDRESS2],"
"))) & " " &
(Right(Trim([mailing_address2]),Len(Trim([mailing_address2]))-InStr(1,[mailing_address2]," ")))

Thank you.
Ofer Cohen - 13 Jul 2006 00:44 GMT
Try

MAILING_ADDRESS_2: IIf(Instr([Mailing_Address2]," ")=0
,[Mailing_Address2],Trim(Left([Mailing_Address2],InStr(1, mAILING_aDDRESS2],"
"))) & " " &
(Right(Trim([mailing_address2]),Len(Trim([mailing_address2]))-InStr(1,[mailing_address2]," "))))
Signature

Good Luck
BS"D

> I'm using the following which is working very well except it not working if
> there are no spaces in the text of the field.  Can someone help?
[quoted text clipped - 4 lines]
>
> Thank you.
Maria - 13 Jul 2006 16:04 GMT
Thanks Ofer.

Unfortunately, I keep getting an Invalid Syntax message when I try to click
out of this field after pasting.

Can you add what's missing???

Maria

> Try
>
[quoted text clipped - 11 lines]
> >
> > Thank you.
John Spencer - 13 Jul 2006 16:56 GMT
MAILING_ADDRESS_2: IIf(Instr([Mailing_Address2]," ")=0
,[Mailing_Address2]
,Trim(Left([Mailing_Address2],InStr(1,[Mailing_Address2]," ")))
& " " &
Trim(Mid([mailing_address2],Instr(1,[Mailing_Address2]," ")+1)) )

IF this gives you trouble, then try breaking this down into steps
IIf(Instr([Mailing_Address2]," ")=0,[Mailing_Address2], "Has Space")
If that works, then add to it
MAILING_ADDRESS_2: IIf(Instr([Mailing_Address2]," ")=0 ,[Mailing_Address2]
,Trim(Left([Mailing_Address2],InStr(1,[Mailing_Address2]," "))))
If that works, then add a bit more.

> Thanks Ofer.
>
[quoted text clipped - 26 lines]
>> >
>> > Thank you.
Maria - 13 Jul 2006 17:58 GMT
Worked great!  Thank you so much!

Maria

> MAILING_ADDRESS_2: IIf(Instr([Mailing_Address2]," ")=0
> ,[Mailing_Address2]
[quoted text clipped - 39 lines]
> >> >
> >> > Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.