If you're trying to summarize data using sum(), you need to use GROUP BY 

CREATE.....SELECT procnum, procdesc, sum(timeout - timein) from workinfo 
where procnum = 'spdy-82' and procdesc contains '222' group by procnum, 
procdesc

If you're simply trying to show the difference between timout and timein 
for each row then just do (timeout - timein), leaving out the word sum.

Dawn Hast



[email protected] wrote on 11/07/2008 10:47:10 AM:

> 
> I am trying to create a temporary view and get an error stating 
> “illegal select function”.  Can anyone look at the code below and 
> tell me what I am doing wrong?
> 
> create temporary view SPEEDYWORK (procnum, procdesc, tottime) as 
> select procnum, procdesc, sum(timeout-timein) from workinfo where 
> procnum = 'spdy-82' and procdesc contains '222'
> 
> Jim
> 

DISCLAIMER: This electronic message together with any attachments is 
confidential. If you are not the intended recipient, do not copy, disclose or 
use the contents in any way. Please also advise us by return e-mail that you 
have received the message and then please destroy. Evergreen Packaging is not 
responsible for any changes made to this message and / or any attachments after 
sending by Evergreen Packaging. We use virus scanning software but exclude all 
liability for viruses or anything similar in this email or any attachment.

Reply via email to