×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Yes, you've hit it right on the head.  Is there more than one row per 
dbmdc#?  If so, then try a group by dbmdc#.  If not, you must eliminate 
dbmdc#.  In some situations people have been able to cheat by using a 
summary function like max(dbmdc#) or some such thing.  Don't know if that 
business logic will apply to your case.

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 




Dan Rasch <drasch@xxxxxxxxxxxx> 
Sent by: midrange-l-bounces@xxxxxxxxxxxx
11/11/2003 03:07 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
cc

Subject
SQL selects







We have a user trying to use SQL to format three fields for a vendor.
this works, although it is not as complete as desired:

SELECT dbmdc# as check, 
       decimal(dbmddt*10000.0000001-10299997997,11,0) FROM dbmtckp
       WHERE dbmcpy ='F' and dbmdc# between 26969 and 26999 
       and dbmddt > 1030000  
SELECT statement run complete. 

this fails:

SELECT dbmdc# as check, 
       decimal(sum(dbmamt)*100,12,0), 
       decimal(dbmddt*10000.0000001-10299997997,11,0) FROM dbmtckp
       WHERE dbmcpy ='F' and dbmdc# between 26969 and 26999 
       and dbmddt > 1030000  
Column DBMDC# or expression in SELECT list not valid. 

Adding the sum function seems to cause a problem,
any clues?

TIA, 

Dan Rasch - because if the human species concentrated on the really 
important things in life, there would be a shortage of fishing poles!
IBM Certified twice....... but still a couple PTFs away from Nirvana.

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing 
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.