473,569 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling Decimals with operators

Hi Folks,
I am trying to make a query that will not return any item larger than 3.000
in a width field, but I have an item returning with a width of 7.500

I am wondering if it is a function of a 3 place decimal field.

Here is the query:
SELECT *
FROM `Catalog`
WHERE `Catalog`.desig ner LIKE 'Victorian' AND `Catalog`.width <3.000
ORDER BY `Catalog`.sold

I've tried it with single quotes, but the item still comes up.
AND `Catalog`.width <'3.000'

What is weird is that the designer field has nothing like Victorian in it,
but it still pops up.

Jeff
~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #1
2 1146
*** Jefferis NoSpamme escribió/wrote (Fri, 11 Mar 2005 14:04:26 -0500):
SELECT *
FROM `Catalog`
WHERE `Catalog`.desig ner LIKE 'Victorian' AND `Catalog`.width <3.000
ORDER BY `Catalog`.sold


You don't even say what DBMS you're using. Assuming it's MySQL, this equals to:

.... WHERE (`Catalog`.desi gner LIKE ('Victorian' AND `Catalog`.width )) < 3
http://dev.mysql.com/doc/mysql/en/op...recedence.html

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--
Jul 17 '05 #2
Thank you!
Jeff

Yes,it is MySql. I also found that my page had a partial query not
completely overwritten, so it was screwing things up badly.

On 3/11/05 4:15 PM, in article 5u************* *************** @40tude.net,
"Alvaro G. Vicario" <kA************ *****@terra.es> wrote:
*** Jefferis NoSpamme escribió/wrote (Fri, 11 Mar 2005 14:04:26 -0500):
SELECT *
FROM `Catalog`
WHERE `Catalog`.desig ner LIKE 'Victorian' AND `Catalog`.width <3.000
ORDER BY `Catalog`.sold


You don't even say what DBMS you're using. Assuming it's MySQL, this equals
to:

... WHERE (`Catalog`.desi gner LIKE ('Victorian' AND `Catalog`.width )) < 3

http://dev.mysql.com/doc/mysql/en/op...recedence.html


~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #3

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

Similar topics

3
5635
by: Oswald | last post by:
Hey, how can I set the number of decimals? Example: 5 decimals 2.12345 2 decimals 2.12 I've found something about NumberFormat in the API, but without an example I can't solve this...
1
3253
by: Sean W. Quinn | last post by:
Hey folks, I have a question regarding file handling, and the preservation of class structure. I have a class (and I will post snippets of code later in the post) with both primitive data structures (ints), and more complex data structures (strings and vectors) in it, and would like to write the entire class to a data file that could then...
2
2213
by: westjon64 | last post by:
i am fairly new to c++, i need to know how to make it so you can input decimals into a file using the cin >> a command instead of just being able to input whole numbers and also how to make it so that it outputs decimals and not just rounded off whole numbers
2
2091
by: Eric Newton | last post by:
VB's more declarative nature of handling events is golden. I'm hoping C# will acquire this type of deal, in addition to the anonymous delegates. could do same as vb (actually would be easier to parse then vb due to braces) whereas you look for Handles keyword after method sig, but before opening brace of the method. compiler would...
6
2606
by: Donal McWeeney | last post by:
Hi, Is there a way to specify on the predefined format strings like P and N that you want displayed all the decimals in the number... for example 3 will display 3 2.1 will display 2.1 3.21 will display 3.21
35
3746
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks gets about 3 or so. It also gets very awkward in nested loops, where you want to check for normal loop processing in the loop condition, not...
13
3000
by: vsts2007 | last post by:
hi, how can I change the number of decimals appeared in access reports... I put a formula in query and its giving three to four decimals in the output of report. I want to change the number of decimals to zero. can anybody guide me in this .
12
2082
by: CNiall | last post by:
I am very new to Python (I started learning it just yesterday), but I have encountered a problem. I want to make a simple script that calculates the n-th root of a given number (e.g. 4th root of 625--obviously five, but it's just an example :P), and because there is no nth-root function in Python I will do this with something like x**(1/n)....
0
1037
by: Edwin.Madari | last post by:
for nth square root: use math.sqrt n times for example ... num = math.sqrt(num) ... 5.0 all comparisons work fine for arbitrary floating point numbers... For readability print them with required precision. for example True (0.20000000000000001, 0.20000000000000001) ('0.20', '0.20')
8
3272
by: =?Utf-8?B?a2FyaW0=?= | last post by:
Hello All, why is this code is not showing the result in this format: 0.00 and showing it as only 0 Private Sub btn1_Click Debug.Print(Format$(Rnd() * 100, "0.00")) Dim d As Double = Math.Round(2250.0, 3) txt2.Text = txt1.Text \ d
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.