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 November 12th, 2003, 11:24 AM
MichaelChang MichaelChang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 MichaelChang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to deal with multi-value fields?

I'm exporting data from Lotus Notes into tab-delimited format that can be imported into Access

This is great for single value fields but in multi-value fields, queries treat the contents as a single value, i.e. "value1 value2 value3" instead of "value1", "value2", "value3"

is there any way to specify a delimiter to designate separate values within a field when doing Access queries?

-MC
PS I know nothing about Access programming

Reply With Quote
  #2  
Old November 12th, 2003, 02:27 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
Re: How to deal with multi-value fields?

I guess I don't quite understand what you are asking. Access doesn't perfrom queries off of text files, only off of Tables and thus you wouldn't specify a delimiter in a query. And when you import text files into an access table it walks you through the process of using tabs as your delimiter and thus would already be seperate values, if they come as seperate fields from Lotus Notes

Please clarify what exactly is the problem.

S-

Reply With Quote
  #3  
Old November 12th, 2003, 04:45 PM
MichaelChang MichaelChang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 MichaelChang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
clarification

From Notes I export/produce a tab delimited text file

e.g.

value1<tab>value2<tab>value3 value4 value5<tab>etc.

value1 is in FieldA and value2 is in FieldB

value3 value4 value5 are three entries contained within a Notes multi-value field (field that accepts multiple values/entries) which
we'll call FieldC

I import the tab delimited text file first into Excel and from Excel I copy/paste it into a predefined MS Access table

The problem is that when I perform MS Access queries on FieldC, it considers the value in FieldC to be "value3 value4 value5" (all one string) rather than "value3", "value4", "value5" (separate entries within the same field)

any ideas?

-MC

Reply With Quote
  #4  
Old November 12th, 2003, 05:54 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
Is there a way to logically seperate the three values in field C

For example: each value is only 4 characters each
3485ijth09iu -->3485 ijth 09iu
OR
space is used to seperate each value
3485 ijth*09iu
Etc

If not, then there is nothing you can do in Access. This is a compatablity problem with Notes. You would be better off finding out is Lotus Notes can seperate these values in to seperate fields before exporting to a txt file.

Food for thought. It takes about the same effort to import into Access as it does for Excel. IF you are going to do this a lot, just by pass using Excel

S-

Reply With Quote
  #5  
Old November 12th, 2003, 06:55 PM
MichaelChang MichaelChang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 MichaelChang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
every multi-value field has some sort of delimiter

it could be a space or a semicolon or something else but there is a way to determine the distinct values

thanks,

-MC

Reply With Quote
  #6  
Old November 12th, 2003, 10:31 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
The the distinction is the same for every record then why don't you post some sample data and lets see if we can help you out.

S-

Reply With Quote
  #7  
Old November 13th, 2003, 10:59 AM
MichaelChang MichaelChang is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 MichaelChang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sample data

Field1 | Field2 | Field3 | Field4
a | b | c d e | f
g | h | i j k | l
m | n | o p q | r

Fields 1, 2, & 4 are single value, if I were to query Field1, I'd get:
a
g
m

Field3 is multi value (space delimited), if I were to query Field3, I'd get:
c d e
i j k
o p q

but I'd want to get:
c
d
e
i
j
k
o
p
q

Hope this clears things up

-MC

Reply With Quote
  #8  
Old November 13th, 2003, 01:29 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
Okay

You have two options

1.
If you try to seperate it in a MS Query the best you can get is the following

table
Field1,Field2,Field3,Field 4
34,rt,5 7 9,rt

Query
Field1,Field2, Field3, Field4, Field5, Field6
34,rt,5,7,9,rt

Not possible in a query
Field1,Field2,Field3,Field 4
34,rt,5,rt
34,rt,7,rt
34,rt,9,rt

OR
2. Write VB code (either in or outside Access) to give you

table1
Field1,Field2,Field3,Field 4
34,rt,5 7 9,rt

table1New
Field1,Field2,Field3,Field 4
34,rt,5,rt
34,rt,7,rt
34,rt,9,rt


You would pull the dataout into variables, seperate the field3, and add the new records to a new table

serperation Syntax for 2.

Value1 = left(OrginalFieldAll,Insrt(1,OrginalFieldAll," ")-1)

OrginalFieldright2 = Mid(orginalfield,Insrt(1,OrginalField," ")+1)

Value2 = left(OrginalFieldright2 ,Insrt(1,OrginalFieldright2 ," ")-1)

OrginalFieldright1 = Mid(OrginalFieldright2 ,Insrt(1,OrginalFieldright2 ," ")+1)

value3 = trim(OrginalFieldright1)




The syntax for 1. does something similar to the above, but done as columns in the query and not as variables

Hope this helps

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > How to deal with multi-value fields?


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 5 hosted by Hostway