473,406 Members | 2,356 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,406 software developers and data experts.

How to perform an opposite of CONCATENATE ON A table

hi
I have a field like "123 || 569" and I would like to keep only the first numbers(123).
Thanks for your help,
lori
Jul 8 '07 #1
2 15714
FishVal
2,653 Expert 2GB
hi
I have a field like "123 || 569" and I would like to keep only the first numbers(123).
Thanks for your help,
lori
Hi!

There are several options here.
  • the length of substring is constant (3 in the example above)
    Expand|Select|Wrap|Line Numbers
    1. Left(strYourString,3)
    will return first 3 characters of a string
  • you want to cut substring from the left to predefined separator ("||" in the example above)
    Expand|Select|Wrap|Line Numbers
    1. Trim(Left(strYourString, InStr(1,strYouString,"||")-1))
    will return substring from the left to "||" trimming unnecessary spaces
Jul 8 '07 #2
NeoPa
32,556 Expert Mod 16PB
Another interesting option, assuming the string holds number strings separated by a character ("|" in this case), is to use Split()
Expand|Select|Wrap|Line Numbers
  1. YourVariable = Split([Field],"|")(0)
Unfortunately, this is limited to running in code (VBA) and will be useless in a query or in SQL code :(
Jul 9 '07 #3

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

Similar topics

0
by: Nick Heppleston | last post by:
I have a concatenation problem and I was wondering if somebody might be able to offer some help :-) I have the following table structure holding product long descriptions: Part...
2
by: Kevin | last post by:
Hello, How do I concatenate two fields in the same table... For example, I have two tables, first one is called familynametable that has a familyID and familyname field. This table is connected...
4
by: Brian Basquille | last post by:
Hello all, Well, we've gotten to it: the real meaty area of my Air Hockey game.. Any help or suggestions for the following would be much appreciated. In plain terms: My paddle needs to be...
3
by: Dave | last post by:
I need to concatenate serveral text files into a larger file. I borrowed some code and patched together a batch file that runs in the command processor and looks like this: echo off chdir...
0
by: Luis Esteban Valencia | last post by:
Hello I am in big troubles trying to concatenate this I have a datalist Private Sub llenardatalistpartidos(ByVal idfase As Int32, ByVal iddeporte As Int32) Dim dr As sqldatareader dr =...
6
by: Sheldon | last post by:
Hi, I am trying to build a large array using concatenate function in python. So as I loop over the number of arrays, of which there are 12 (4 down and 3 across), I create 3 long arrays by...
4
by: Dan | last post by:
Hi all, I am creating a search table where the keywords field is made up of several text fields and this is causing me some problems. I can concatentate the text ok but i can't seem to concatenate...
12
by: parth | last post by:
Hi I want to achieve the following transformation of data using a stored procedure. Source col1 col2(varchar) -------------------------
10
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
6
by: mark83anthony | last post by:
How do I concatenate strings from a column into a single row? Whats the logic to create the function in DB2. Given is below. Color ------ red orange
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: 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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.