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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Returns wrong values when filter added 1

Status
Not open for further replies.

FinalPrime

Technical User
Jul 28, 2003
50
US
I query into sql sever with parameter for a field <call it X> with DataType Decimal, precision 2, scale 5, decimal places auto.
When parameter for field X is ommited, correct values in X are returned with the query.
When Field X filter is used, returned values are zero.
example filter (TotalValues.Footage >= 1300 AND TotalValues.Footage <= 1500 ).

DataType Decimal, precision 2, scale 5, decimal places auto for X is acertained by my linking to the
file from an Access DB and viewing Design View. Query is through Crystal SQl Designer

What gives? Correct values should return and filter should work.
thanks
finalPrime
 
You didn't provide your code or samples of data and what you want so it's really difficult to say what is wrong. Are you sure there is data that matches your filter?

-SQLBill

Posting advice: FAQ481-4875
 
>> Decimal, precision 2, scale 5, decimal places auto

Nope. That's not possible.

According to books on line...

Scale must be a value from 0 through p. The default scale is 0; therefore, 0 <= s <= p.

Scale must be greater than or equal to 0 and less than or equal to the precision.

In sql server, precision represents the TOTAL number of digits, while scale represents the number of digits after the decimal point.

So... Precision 5, Scale 2 has a range of -999.99 to 999.99

Since the maximum number is 999.99, there won't be any records with a value between 1300 and 1500.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
George,
thanks for the education. much appreciated
finalprime
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top