A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access equiv. of Excels =Search("_",A1)



 
 
Thread Tools Display Modes
  #1  
Old October 8th, 2004, 04:19 PM
Duncan
external usenet poster
 
Posts: n/a
Default Access equiv. of Excels =Search("_",A1)

When reducing UK Postcodes from unit postcode MK19_1PY to Postcode Sector
MK19_1 I used to use =Search("_",A1) to identify the position of the blank in
the text string.

In the MK19_1PY example, the result would be character number 5 in Cell B1.
I would then use =Left(A1,B1+1) to provide me with the shortened Post Code
sector. UK postcode blanks are not in a uniform position eg WN1R_2XN, so it
is necessary to identify position of blank.

How do I write the above to functions when using Access Expression builder?

D
  #2  
Old October 8th, 2004, 05:44 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

InStr is the equivalent of Search.

You should be able to do it all in one statement:

Left([PostCode], InStr([PostCode], " ") + 1)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Duncan" wrote in message
...
When reducing UK Postcodes from unit postcode MK19_1PY to Postcode Sector
MK19_1 I used to use =Search("_",A1) to identify the position of the blank

in
the text string.

In the MK19_1PY example, the result would be character number 5 in Cell

B1.
I would then use =Left(A1,B1+1) to provide me with the shortened Post Code
sector. UK postcode blanks are not in a uniform position eg WN1R_2XN, so

it
is necessary to identify position of blank.

How do I write the above to functions when using Access Expression

builder?

D



 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion Problems Katherine R New Users 11 December 19th, 2004 12:38 AM
Access XP Compared to Access 2003 Mardene Leahu New Users 1 October 1st, 2004 05:11 AM
What is MDE Charlie General Discussion 4 August 24th, 2004 04:15 PM
Data from Excel to Access Database Design 2 August 20th, 2004 12:53 PM
Useless Access 2003 tired, angry, sucidial and bored General Discussion 10 July 21st, 2004 11:52 PM


All times are GMT +1. The time now is 08:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.