Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 24th, 2004, 02:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default Query Criteria

I have a query field comprising a text string of seven digits, eg 2220603.

The following criteria works ok, as does replacing the wild card groups with, eg, the contents of a text box.

Like "???" & "06" & "??"

But how can I make the middle group something like >=06 please/


Clive Astley
__________________
Clive Astley
Reply With Quote
  #2 (permalink)  
Old March 24th, 2004, 03:11 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

use hte mid function
Mid([Fieldname],4,2)

4 is the beginning of the string, 2 is the length

then check if value >06



Sal
Reply With Quote
  #3 (permalink)  
Old March 24th, 2004, 07:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Sal. That's ok for just testing the middle bit. But how do I join it to the other two tests?

Like "222" & Mid([FieldName],4,2)>06 & "04"

doesn't work.

Clive Astley
Reply With Quote
  #4 (permalink)  
Old March 24th, 2004, 11:19 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sounds like you are trying to do this

Left([FieldName],3) and
Mid([FieldName],4,2)>06 and
right([FieldName]),2)="04"

You are looking for all 3 to be true. Is that right?

Anyway, search the Access help for "Expresions". There you can lookup the expressions for text.



Sal
Reply With Quote
  #5 (permalink)  
Old March 25th, 2004, 03:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Norwich, Norfolk, United Kingdom.
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again Sal. Got it now. Don't know why I had the difficulty with it; have used similar in the past. I seem to have got into the mindset of using the Like operator. Senior moments of old age! Thanks again and best wishes,

Clive Astley
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expressions in query criteria thedom Access 2 December 13th, 2007 04:33 PM
ListBox as Query criteria? PubliusHJM Access 8 August 28th, 2007 06:14 AM
Conditional criteria in query dfuas BOOK: Beginning Access VBA 0 January 15th, 2006 03:19 PM
Criteria in Query lryckman Access 1 June 23rd, 2004 11:11 AM
Append Query Criteria Ben Access 1 January 21st, 2004 07:24 AM



All times are GMT -4. The time now is 06:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.