Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Better Substitute that If Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KimC - 23 Jan 2008 00:17 GMT
I'm needing to display the correct area code for the corresponding postcode,
row two is the example i'm needing to display. The postcode is already there,
it the area code i need the formula for.

          A               B
1    Postcode    AreaCode
2       2148           02

The data is
1XXX & 2XXX = 02
3XXX, 7XXX & 8XXX = 03
4XXX & 9XXX = 07
0XXX, 5XXX & 6XXX = 08

The "X" refer to different numbers that may be entered.

Thanks in advance
Bob Quintal - 23 Jan 2008 02:32 GMT
> I'm needing to display the correct area code for the corresponding
> postcode, row two is the example i'm needing to display. The
[quoted text clipped - 14 lines]
>
> Thanks in advance

select case left(postcode,1)
case "1" , "2"
areacode = "02"
case "3" , "7" , "8"
areacode = "03"
case "4" , "9"
areacode = "07"
case "0" , "5" , "6"
areacode = "08"
case else
areaCode = "indeterminate"
end select

Signature

Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.