× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Chandana Silva wrote:
<<SNIP>>

The Concatenation below works but the results are bad ..
Select sum(SALES) From DaySales
WHERE CPY = 22 and SDSTR = 1234 AND
DIGITS(2009) CONCAT'-' CONCAT DIGITS (07) CONCAT'-'
CONCAT DIGITS(15) BETWEEN '2009-07-14' AND '2009-08-10';

I tried:
Select sum(SALES) From DaySales WHERE CPY = 22 and SDSTR = 1234 AND
DIGITS(2009) CONCAT DIGITS (07) CONCAT DIGITS(15)
BETWEEN '20090714' AND '20090810';

Off by Ml.s

Suggesting that "results are bad" and "off by Ml.s" is not helpful to those who might choose to assist.

The DIGITS() function will not automatically cast to a character string matching the length of the numeric literal. The numeric field or literal will need to have exactly two-digits in precision, or must be CAST as such [before casting to its DIGITS character string form]. The literals will be treated as integer, which have a precision of ten. Per that error, the latter requests the equivalent of:
"AND '000000200900000000070000000015' BETWEEN '20090714'..."


Multiplication below, Returns Zeo (.)

Select sum(SALES) From DaySales WHERE SDCPY = 88 and SDSTR = 1234 AND
((2009*10000) + (07*100) + 15) BETWEEN '20090714' AND '20090810';

<<SNIP>>


Similar to the prior poor explanation of results, what does "returns zeo (.)" mean? Perhaps "zero records"? Seems odd, since even though the expression is numeric and the comparison values are character strings, the implicit cast of either should give the results just as if all were instead, proper DATE data type values.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.