Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 13th, 2004, 02:32 PM
Jon2112 Jon2112 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 19 Jon2112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Having Trouble Trimming Text

I have a table that has text eg: MyText#OtherText#. I would like to keep the text to the left of the # symbol but get rid of all text to the right of the # symbol. Can anyone help me with this

Thanks In Advance
Jon

Reply With Quote
  #2  
Old February 13th, 2004, 04:02 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
varaible = left([TableField],instr(1,[TableField],"#")-1)
S-

Reply With Quote
  #3  
Old February 13th, 2004, 04:20 PM
Jon2112 Jon2112 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 19 Jon2112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
New

Could you give me a better explantion as to what to do with the string you provided. Do I use this in a qry?

Thanks
Jon

Reply With Quote
  #4  
Old February 13th, 2004, 04:39 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
What do you want to do with your new value, all I gave you was the code (to be used in as a query expression, or in VBA).

S-

Reply With Quote
  #5  
Old February 13th, 2004, 05:32 PM
Jon2112 Jon2112 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 19 Jon2112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have 400 records that I want to get rid of the # symbol and all the text to the right of it eg:

eggs#bacon#
toast#jam#
Orange#Juice#

I want to eliminate the #bacon# from the eggs#bacon# etc. So I am left with eggs etc in the Products field of my table.

Reply With Quote
  #6  
Old February 14th, 2004, 03:45 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
UPDATE Table3 SET Table3.Product = left([Table3.Product ],instr(1,[Table3.Product ],"#")-1);

S-

Reply With Quote
  #7  
Old February 15th, 2004, 04:40 PM
Jon2112 Jon2112 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 19 Jon2112 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It Worked

It worked Thank you very much

Jon

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Having Trouble Trimming Text


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT