MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
select POSHEADER.transact, right(replicate('0',4) + convert(varchar,POSHEADER.snum),4), POSHEADER.statnum, whoclose, convert(varchar, timeend ,120), case when POSHEADER.finaltotal > 0 then 'Sale' else 'Return' end as Type, case when POSHEADER.status = 3 then 'Successful' else 'Failed' end as Status, METHODPAY.descript, (select sum(costeach*quan) from dba.posdetail where prodtype in (0,1) and opendate = 20130628 and posdetail.transact = posheader.transact group by posheader.transact) as ItemTotal , finaltotal, tax1, whoclose from dba.POSHEADER, dba.HOWPAID, dba.METHODPAY where POSHEADER.transact = HOWPAID.transact and HOWPAID.methodnum = METHODPAY.methodnum and HOWPAID.approved = 1 and POSHEADER.opendate = 20130628 and POSHEADER.transact not in (Select transact from dba.posheader where transact in (Select transact from dba.posdetail Group by transact having Count(*) = 1) and opendate = 20130628 ) order by POSHEADER.transact
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|date diff with Fiscal Calendar||4||75|
|Select values in a row based on values in another row in sql||4||31|
|Selecting only the rows where duplicates exist in specified columns within those rows||3||30|
|how to make geography query faster? SQL||7||43|