Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2004, 09:03 PM
Authorized User
 
Join Date: Sep 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default String Manipulation

I am trying to create a query that extracts the left most 3 characters from a particular field. For example, in the Criteria line of the query pane, I want to look at the field and only show it in the results if the first three letters in the field are "Feb". The entire field may read "Feb, May, Aug, Nov" or it could read "Mar, June, Sep, Dec", or some other quarterly string. I am trying to extract the first three letters, because it is a fairly large table and the data entry is not consistent through out. I can reasonable expect that the first three letters are consistant, so that is why I only want to look those characters.

Thanks,

David

 
Old February 22nd, 2004, 09:13 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, since you didn't give any field names, you will have to change it to whatever is applicable. Use the left function like the following:

Left([Fieldname],3)

Regards,

Beth M
 
Old February 22nd, 2004, 10:23 PM
Authorized User
 
Join Date: Sep 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Beth M,

I spent about an hour trying to figure this one out. Thanks for saving me more frustrations.

David

 
Old February 23rd, 2004, 09:57 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My pleasure :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
String manipulation Franco1 Visual Basic 2005 Basics 1 July 16th, 2008 12:53 PM
String manipulation john316 SQL Language 1 October 1st, 2007 04:24 PM
String manipulation pcase XSLT 5 June 14th, 2007 10:32 AM
String manipulation YoungLuke C# 4 May 4th, 2007 01:46 AM
String Manipulation Ben Access VBA 2 July 8th, 2003 05:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.