Analytics

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-21-2015
05:45 PM

02-21-2015
05:45 PM

Thanks.

4 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-23-2015
12:08 PM

02-23-2015
12:08 PM

No,

Use one or the other,

Between is inclusive and can also be stated using ">= n and <= n"

Rglass

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-23-2015
12:56 PM

02-23-2015
12:56 PM

Hi Glass -but then how do I eliminate double couting 1.0 or 2.0, as it would qualify for both categories. The values are floating decimals so I need to ensure the correct values are falling into correct categories without leaving any out, or double couting. "between 1.0001 and 2.0" then "between 2.0001 and 3.0"? Was hoping for something a little cleaner and precise than that. Any ideas?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-23-2015
02:10 PM

02-23-2015
02:10 PM

Simply don't use BETWEEN, replace it with >= and < instead:

SUM (CASE WHEN d.DCG >=0.50 and d.DCG <1.0 THEN 1 ELSE 0 END) AS "0.5-1.0",

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

02-23-2015
03:02 PM

02-23-2015
03:02 PM

Thank you Dieter that worked perfectly.

Copyright © 2004-2015 Teradata Corporation. Your use of this Teradata website is governed by the Privacy Policy and the Terms of Use, including your rights to materials on this website, the rights you grant to your submissions to this website, and your responsibilities regarding your conduct on this website.

The Privacy Policy and Terms of Use for this Teradata website changed effective September 8, 2016.

SUM (CASE WHEN d.DCG < 0.50 THEN 1 ELSE 0 END)AS "<0.5",

SUM (CASE WHEN d.DCG between >=0.50 and <1.0 THEN 1 ELSE 0 END) AS "0.5-1.0",

SUM (CASE WHEN d.DCG between >=1.0 and <2.0 THEN 1 ELSE 0 END) AS "1.0-2.0",

SUM (CASE WHEN d.DCG >=2.0 THEN 1 ELSE 0 END)AS ">2.0"

Tried this and getting an error: 3706 expected something between the "between" keyword and ">=".

Works fine when I remove the >= but then I'm double counting some values. Any idea whats wrong here and how to get around this so I am not ommitting any floating decimals in my output or double counting any numbers?