Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple query doesn't work 2

Status
Not open for further replies.

brianpercival

Programmer
Jun 13, 2005
63
US
Hi all,

here is my query, a seemingly very simple one, but it doesn't work

SELECT [f1], [f1Total],
FROM [t1] where (( [f1]/[f1Total])<=0.8);

The error is "The expression is typed incorrectly or is too complex to be evaluated........"

Works fine if I remove the division check. What am I doing wrong?

regards,
Brian
 
Are f1 and f1Total both numeric fields in t1 ?
To avoid some overflow issue (division by zero) you may try this:
WHERE f1<=0.8*f1Total

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 


Hi,

SYNTAX
Code:
SELECT [f1], Sum([f1])
FROM [t1] 
Group By [f1]
Having [f1]/Sum([f1])<=0.8;

Skip,
[sub]
[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue][/sub]
 
PHV,

thanks a lot. I wasn't thinking.. Actually everything was working fine before. Meaning, the exact query that was written like three years ago has been working fine until now and suddenly it decides it cann't do it anymore. Kinda threw me off the track. thanks again.

regards,
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top