Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 multiply fields

Author  Topic 

maximgor
Starting Member

7 Posts

Posted - 2008-01-31 : 16:43:13
In derived fields, I need to multiply numbers from 2 fields. Assume that I need to multiply numbers from field B and field C. Although, B is found by COUNT (field A). So, I do the following: B*AltName of A. It gives me an error. Thank you for any help!

MG

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2008-01-31 : 17:01:55
You're not really giving a lot of helpful info here.
How about posting your code and what the error is, some DDL would be even better.

Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page

maximgor
Starting Member

7 Posts

Posted - 2008-01-31 : 17:41:45
Code for error "Internal Failure occurred inquery processor":

SELECT nwdocnum.patients, nwdocnum.patients NAME(NWDOCNU_01), phname.phymast, YEAR(ISDDATE) NAME(DISCHYR) COLHDG("DISCHYR"), MONTH(isddate) NAME(DISCHMTH) COLHDG("DISCHMTH"),
WEEK(ISDDATE) NAME(DISCHWK) COLHDG("DISCHWK"), drg.patients, drgdes.drgdesc, abdrgw.mrabmstr, COUNT(drgdes) NAME(CASES) COLHDG("CASES"), abals.mrabmstr, ABDRGW*CASES NAME(CMI) COLHDG("CMI"),
abels.mrabmstr, ABELS*CASES NAME(GM_SUM) COLHDG("GM_SUM")
FROM hospf001/patients,hospf001/mrabmstr,hospf001/drgdesc,hospf001/phymast
PARTIAL OUTER JOIN patno.patients=abnumb.mrabmstr and nwdocnum.patients=nwdrnum.phymast and drg.patients=drg.drgdesc
WHERE ISDDATE BETWEEN "&&FROM" AND "&&THROUGH" AND NWDOCNUM=16
GROUP BY nwdocnum,NWDOCNU_01,phname,DISCHYR,DISCHMTH,DISCHWK,drg,drgdes,abdrgw,abals,CMI,abels,GM_SUM
ORDER BY NWDOCNU_01 Asc,DISCHWK Asc

MG
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2008-01-31 : 18:41:43
You do know this is an SQL Server site right ? What are you running this query on ? AS/400 ?

Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page

maximgor
Starting Member

7 Posts

Posted - 2008-02-01 : 07:17:12
I am aware where I am. I do run it on SQL Server.

MG
Go to Top of Page
   

- Advertisement -