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 May 16th, 2008, 03:51 PM
apgriffiths apgriffiths is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 10 apgriffiths User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 11 m 47 sec
Reputation Power: 0
General - Help with Truncating a value

Hi All

Im pretty much a beginner with Access. I have created a database with 2 tables. The first table has about 1.8 million lines and each line contains full UK postcodes,

eg. AB10 1AA.

In the other table i have a list of destinations and postcode sectors,

eg. AB10 1

I need to use to link the tables by the full postcode and postcode sector. In excel i would just truncate the value. How can i do this in access??

Any help would be much appreciated.

Antony

Reply With Quote
  #2  
Old May 16th, 2008, 04:04 PM
AOG123's Avatar
AOG123 AOG123 is offline
Registered Hero
ASP Free Novice (500 - 999 posts)
 
Join Date: Oct 2006
Posts: 975 AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level)AOG123 User rank is General 5th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 14 m 43 sec
Reputation Power: 1326
You may need to investigate into this a little more,..

Take a look at this link,..

<<String Functions >>

For example,.. either of the following gives the result as requested above,.. but maybe not for all your records,


create a query

Mid([Fld],1,6)

or

Left([Fld],6)

etc
Comments on this post
sbenj69 agrees!

Reply With Quote
  #3  
Old May 16th, 2008, 04:04 PM
sbenj69's Avatar
sbenj69 sbenj69 is offline
Redneck 'puter fell'r
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2007
Location: Redneck part of Illinois
Posts: 1,728 sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)sbenj69 User rank is General 7th Grade (Above 100000 Reputation Level)  Folding Points: 307628 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307628 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307628 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307628 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307628 Folding Title: Super Ultimate Folder - Level 1Folding Points: 307628 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 1 Day 14 h 59 m 22 sec
Reputation Power: 1466
Query1
Expr1: Left([yourpostcode],6)
then your fields

Query2
Expr2: Left([yoursector],6)
then your fields

Query3 -------- Use Query1 - Expr1 and Query2 - Expr2, many to one (many Expr1's to one Expr2
then your fields
Comments on this post
AOG123 agrees:
__________________
Did I help you? If so gimme rep by clicking on the scales at the top right corner of this post

Madness does not always howl. Sometimes, it is the quiet voice at the end of the day saying, "Hey, is there room in your head for one more?"

Reply With Quote
  #4  
Old May 16th, 2008, 06:00 PM
apgriffiths apgriffiths is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 10 apgriffiths User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 11 m 47 sec
Reputation Power: 0
Is it possible to add a column in the table that uses the following criteria,

Left([Postcode],Len([Postcode])-2)

I know that i can do this in excel. Is this how it is done in access?

Reply With Quote
  #5  
Old May 16th, 2008, 06:10 PM
don94403's Avatar
don94403 don94403 is offline
Contributing User
Click here for more information.
 
Join Date: Jan 2007
Location: Northern California
Posts: 2,886 don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level)don94403 User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 1 Day 1 h 18 m 41 sec
Reputation Power: 562
Quote:
Originally Posted by apgriffiths
Is it possible to add a column in the table that uses the following criteria,

Left([Postcode],Len([Postcode])-2)

I know that i can do this in excel. Is this how it is done in access?

You probably should not do that. Excel is a spreadsheet and it is common to store calculated data in its "cells." Access is not a spreadsheet, rather it is a relational database. You should avoid storing calculated values in relational tables, because doing so will cause many future problems for you. The other guys have given you good tips on the way to do it.
__________________
Experience is the thing you have left when everything else is gone.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > General - Help with Truncating a value


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





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek