473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

taking the last 'comma' off a text string.

I concatenated a groups of fields into one string field ignoring any 'null' values. Worked OK except when the last field in 'null' i get a comma. I've trimmed the field to eliminate all blanks and tried the variations of the following:
Expand|Select|Wrap|Line Numbers
  1. xx: IIf([x]=',',Right([NewDesc3],Len([NewDesc3])-1),[NewDesc3])
  2. *the value of 'x' is the last character of the field.
I'm just working the the design view of Access 2007.
It sounds simple enough be i'm having no luck
Mar 12 '13 #1
5 6427
Seth Schrock
2,965 Expert 2GB
You are close, but your 'X' needs to be the right function and the 'true' path needs the left function. Like this:
Expand|Select|Wrap|Line Numbers
  1. IIF(Right(NewDesc3, 1) = ',' ,
  2. Left(NewDesc3, Len(NewDesc3) - 1),
  3. NewDesc3)
This tests for the right most character to see if it is a ,. If it is then it gets all the characters for the length of the string except the last one.
Mar 12 '13 #2
You know it runs without error but doesn't display any result.
Mar 13 '13 #3
Seth Schrock
2,965 Expert 2GB
No matter what the data or only when there is a comma at the end or only if there isn't a comma at the end?
Mar 13 '13 #4
Doesn't seem to matter just doesn't return any value. I have the boxed checked just doesn't show the column. Doesn't stop for a bad expression or return an #error.

Shouldn't be this hard!
Mar 13 '13 #5
Seth Schrock
2,965 Expert 2GB
Create another field that just has
Expand|Select|Wrap|Line Numbers
  1. Right(NewDesc3, 1)
make sure that gets what you want. Then do
Expand|Select|Wrap|Line Numbers
  1. Len(NewDesc3) - 1
Keep working through all the individual steps and then start putting them together. Keep testing after each change and then let us know where/when it breaks.
Mar 13 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jcabc | last post by:
I have a text string which has multiple values seperated by commas. My goal is to find the postion of the 4th comma and then read the text after that comma until the next comma using VBA. Ex. ...
3
by: RSB | last post by:
Hi Everyone, How do i convert an Array to a Comma Separated String.. Is there any direct Function... Thanks RSB
7
by: hazz | last post by:
yes i should know this but ... V,-1,1,2,-1,333,5 I would like to return the value from any position within the comma delimited string position 1 is "v" position 2 is "-1" position 6 is...
25
by: electrixnow | last post by:
in MS VC++ Express I need to know how to get from one comma delimited text string to many strings. from this: main_string = "onE,Two,Three , fouR,five, six " to these: string1 =...
1
by: Chris Lane | last post by:
Hi, I want to stream a comma separated string to the browser and have excel open up in the browser. How can I do this? This is not a file on disk, this is a string in memory. Thanks
13
by: SuvarnaChaudhari | last post by:
Hi,I am new to .net. As per ur guidance I tried myString = myString.SubString(0,myString.Length-1); I also used str.lastindexof n str.remove,but by using this I m gettin string as ' (B193 '' H13 ''...
1
by: vishakha209 | last post by:
I want to use comma delimited string as an input for stored procedure. how to delimit the string and access the values? can anybody help ....
4
by: Ahmed, Shakir | last post by:
I need to remove text string from the list of the numbers mentioned below: 080829-7_A 070529-5_c 080824-7_O 070405_6_p The output will be : 080829-7 070529-5
3
by: shapper | last post by:
Hello, I need to replace the last comma in a string by " and ". How can I do this? Thanks, Miguel
4
by: bullfrog83 | last post by:
I wrote a function that takes a comma-separated string, parses out the individual values, places quotations around each value and a comma in-between each value so that they can be processed in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.