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.
| Author |
Topic |
|
stumbling
Posting Yak Master
104 Posts |
Posted - 2007-08-10 : 10:15:06
|
| Hi AllWhat am i doing wrong with this im tired and for the life of me it wont workCheersPhilif(Select sum(Unitprice*qtysold) from #DataExport_tmp where recordtype = 'L'group by transref )<> select Totalcost from #DataExport_tmp where recordtype = 'T'BEGIN PRINT 'no good'end |
|
|
ashley.sql
Constraint Violating Yak Guru
299 Posts |
Posted - 2007-08-10 : 11:14:15
|
| can u post some sample data along with scripts for tablesAshley Rhodes |
 |
|
|
ashley.sql
Constraint Violating Yak Guru
299 Posts |
Posted - 2007-08-10 : 11:17:03
|
| TRY THISif(Select sum(Unitprice*qtysold) from #DataExport_tmp where recordtype = 'L'group by transref )<> (select Totalcost from #DataExport_tmp where recordtype = 'T')BEGINPRINT 'no good'endAshley Rhodes |
 |
|
|
stumbling
Posting Yak Master
104 Posts |
Posted - 2007-08-10 : 11:56:03
|
quote: Originally posted by ashley.sql TRY THISif(Select sum(Unitprice*qtysold) from #DataExport_tmp where recordtype = 'L'group by transref )<> (select Totalcost from #DataExport_tmp where recordtype = 'T')BEGINPRINT 'no good'endAshley Rhodes
Thanks for that CheersPhilMust go to bed ow so tired now. LOL |
 |
|
|
|
|
|