By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,704 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,704 IT Pros & Developers. It's quick & easy.

Queries: Problem with BETWEEN statement when referring to table

P: 16
Hi all,

In my query I am trying to select values from my table ("data table") which lie between two values that are stored in a different table ("Contract list double 71")


My Code is:


SELECT [Contract list double 71].[71 contracts] AS Contract, [Data table].eclass
FROM [Data table],[Contract list double 71]
WHERE ((([Data table].eclass) Between [Contract list double 71]![From] & [Contract list double 71]![To]));

But it informs me about a Syntax Error. Is there a way to work around this?

Thanks

Remaniak
Dec 5 '06 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,656
Try using the (.) instead of the (!) :
Expand|Select|Wrap|Line Numbers
  1. SELECT [Contract list double 71].[71 contracts] AS Contract, [Data table].eclass
  2. FROM [Data table],[Contract list double 71]
  3. WHERE ((([Data table].eclass) Between [Contract list double 71].[From] & [Contract list double 71].[To]));
Dec 5 '06 #2

P: 16
Try using the (.) instead of the (!) :
Expand|Select|Wrap|Line Numbers
  1. SELECT [Contract list double 71].[71 contracts] AS Contract, [Data table].eclass
  2. FROM [Data table],[Contract list double 71]
  3. WHERE ((([Data table].eclass) Between [Contract list double 71].[From] & [Contract list double 71].[To]));
GREAT!

This worked out fine. Though it made me change the & to an AND as well.

Anyways, thanks a lot!

Remaniak
Dec 6 '06 #3

NeoPa
Expert Mod 15k+
P: 31,656
No problem.
Glad you got sorted :).
Dec 6 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.