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  

Remove “www.” from a text string result in Access ExpressionBuild



 
 
Thread Tools Display Modes
  #1  
Old April 19th, 2010, 02:47 PM posted to microsoft.public.access.queries
setver
external usenet poster
 
Posts: 1
Default Remove “www.” from a text string result in Access ExpressionBuild

I have an expression with which I am determining whether or not there is a
value for certain fields, then using either a Null string result, one of the
field values, or finally, the resulting value which gives me a website
address. The problem is that my result needs to have the "www." portion
removed from this last resulting string. Is there a proper expression to
remove the first four characters from the string? Will it be necessary to
build a second query to do this?
  #2  
Old April 19th, 2010, 02:58 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default Remove “www.” from a text string result in Access ExpressionBuild

You could use something like the Mid or Right functions to remove the first 4
characters, but I see a problem. Not all web sites start with www. . I
suggest that you check into the Replace function as it will only mess with
the www.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"setver" wrote:

I have an expression with which I am determining whether or not there is a
value for certain fields, then using either a Null string result, one of the
field values, or finally, the resulting value which gives me a website
address. The problem is that my result needs to have the "www." portion
removed from this last resulting string. Is there a proper expression to
remove the first four characters from the string? Will it be necessary to
build a second query to do this?

  #3  
Old April 19th, 2010, 03:02 PM posted to microsoft.public.access.queries
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default Remove “www.” from a text string result in Access ExpressionBuild

hi,

On 19.04.2010 15:47, setver wrote:
Is there a proper expression to
remove the first four characters from the string? Will it be necessary to
build a second query to do this?

Try this:

IIf(InStr(Nz([field], ""), "www.") = 1, Mid([field], 5), [field])



mfG
-- stefan --
 




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


All times are GMT +1. The time now is 06:39 PM.


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