If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Easy TRIM question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-03-04, 16:28
rob7765 rob7765 is offline
Registered User
 
Join Date: Oct 2002
Location: Houston, TX
Posts: 34
Easy TRIM question

I have an 11 digit code called photo_code. 10401610016

I want to split it up into two variables called code1 and code2

code1 should be the first 6 digits of photo_code
code2 should be the last 5 digits of photo_code

I know that this can be done with a couple of simple TRIM statements but I cannot seem to figure out how to make this work with variables.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 11-03-04, 16:30
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
code1 = Left(photo_code, 6)
code2 = Right(photo_code, 5)
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 11-03-04, 16:47
rob7765 rob7765 is offline
Registered User
 
Join Date: Oct 2002
Location: Houston, TX
Posts: 34
Thanks! I had the order wrong!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On