473,378 Members | 1,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Between expression and text fields

I want to create a query using the criteria that the query only
returns numbers within a specific range. The catch is that this is a
text field, not a number. What is the Syntax for the Between command
to do this?

This is what I am currently using that doesn't work. Do I need to
convert the text to a numeric data type?

Between "19316" And "19396"

May 8 '07 #1
2 4563
On May 8, 1:36 pm, mscu...@gmail.com wrote:
I want to create a query using the criteria that the query only
returns numbers within a specific range. The catch is that this is a
text field, not a number. What is the Syntax for the Between command
to do this?

This is what I am currently using that doesn't work. Do I need to
convert the text to a numeric data type?

Between "19316" And "19396"
You have the correct syntax for a query created in the QBE grid but
not a Query created as a VBA string.

In VBA the query would look like this

Dim strSQL
strSQL = "Select YourTable.YourField from YourTable where
YourTable.YourField between '16316' and '19396'"

Note the single quotes surrounding the values of the text fields
May 8 '07 #2

<ms*****@gmail.comwrote in message
news:11**********************@y5g2000hsa.googlegro ups.com...
I want to create a query using the criteria that the query only
returns numbers within a specific range. The catch is that this is a
text field, not a number. What is the Syntax for the Between command
to do this?

This is what I am currently using that doesn't work. Do I need to
convert the text to a numeric data type?

Between "19316" And "19396"
The above criteria will also return "1932". Access treats numbers stored as
text like any other text, left to right. If this is a problem convert to
numeric or format with leading zeros so all the strings have the same
length.
May 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Tina Li | last post by:
Hello, I've been struggling with a regular expression for parsing XML files, which keeps giving the run time error "maximum recursion limit exceeded". Here is the pattern string: ...
2
by: GIMME | last post by:
I can't figure an expression needed to parse a string. This problem arrises from parsing Excel csv files ... The expression must parse a string based upon comma delimiters, but if a comma...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
8
by: Mojca | last post by:
What is formula that get days between two dates? Npr: 11.03.1998 – 1.7.2005 Thank you, Mojca
11
by: Dimitris Georgakopuolos | last post by:
Hello, I have a text file that I load up to a string. The text includes certain expression like {firstName} or {userName} that I want to match and then replace with a new expression. However,...
9
by: Alan Mailer | last post by:
Ok, my Access 2002 language writing skills are VERY rusty,. I would know how to do what I need using SQL Server's "Coalesce' function, but I don't have that available to me in the Access 2002...
18
by: njgreen2001 | last post by:
I thought the length of this might give me problems. Any suggestions on how to shorten it? Expression: =IIf(="A Pos" And ="A Pos",(DLookUp("","")), IIf(="A Pos" And ="A...
10
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this...
20
by: TimeHorse | last post by:
I would like to gauge interest in the following proposal: Problem: Assignment statements cannot be used as expressions. Performing a list of mutually exclusive checks that require data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.