how to split a column in MS Access

A

Ata Chaudhry

I need to split a column in MS ACCESS, where In most rows of the column I
have a splitter as ":" Can someone please help and post the answer to my
Hotmail address:
(e-mail address removed)
thanks
 
D

Douglas J. Steele

Depending on exactly what you're trying to do, you can use InStr to
determine where the ":" occurs, then use the Left function to get everything
in front of the ":" or the Mid function to get everything after it:

Left([MyField], InStr([MyField], ":") - 1)
Mid([MyField], InStr([MyField], ":") + 1)

If you're using Access 2000 or newer, you can also use the Split function:

Split([MyField], ":")(0) will give you what's in front of the ":",
Split([MyField], ":")(1) will give you what's after it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ata Chaudhry said:
I need to split a column in MS ACCESS, where In most rows of the column I
have a splitter as ":" Can someone please help and post the answer to my
Hotmail address:
(e-mail address removed)
thanks

Sorry, that's not how newsgroups work. When you post your question in the
newsgroup, you come back to the newsgroup to get the answer.
 
H

hermie

I not see the split function in the built-in functions? I have access 2000?

Herman
Douglas J. Steele said:
Depending on exactly what you're trying to do, you can use InStr to
determine where the ":" occurs, then use the Left function to get everything
in front of the ":" or the Mid function to get everything after it:

Left([MyField], InStr([MyField], ":") - 1)
Mid([MyField], InStr([MyField], ":") + 1)

If you're using Access 2000 or newer, you can also use the Split function:

Split([MyField], ":")(0) will give you what's in front of the ":",
Split([MyField], ":")(1) will give you what's after it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ata Chaudhry said:
I need to split a column in MS ACCESS, where In most rows of the column I
have a splitter as ":" Can someone please help and post the answer to my
Hotmail address:
(e-mail address removed)
thanks

Sorry, that's not how newsgroups work. When you post your question in the
newsgroup, you come back to the newsgroup to get the answer.
 
D

Douglas J. Steele

Don't know where you're looking. Split was definitely introduced in Access
2000.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



hermie said:
I not see the split function in the built-in functions? I have access 2000?

Herman
Douglas J. Steele said:
Depending on exactly what you're trying to do, you can use InStr to
determine where the ":" occurs, then use the Left function to get everything
in front of the ":" or the Mid function to get everything after it:

Left([MyField], InStr([MyField], ":") - 1)
Mid([MyField], InStr([MyField], ":") + 1)

If you're using Access 2000 or newer, you can also use the Split function:

Split([MyField], ":")(0) will give you what's in front of the ":",
Split([MyField], ":")(1) will give you what's after it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ata Chaudhry said:
I need to split a column in MS ACCESS, where In most rows of the
column
I

Sorry, that's not how newsgroups work. When you post your question in the
newsgroup, you come back to the newsgroup to get the answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top