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 |
devid3an
Starting Member
2 Posts |
Posted - 2013-11-06 : 03:39:53
|
hey I have 3 specific where searches in where command I want to add a defined text to each specific where query if that makes sense. highlighted in red, how do I do this? going to add status after and then do pivot table afterwards.thanks SELECT POHEAD.DocumentNo ,POHEAD.CreditorCode ,POHEAD.InternalReference ,POHEAD.QuantityOrdered ,POHEAD.Z_ArrivalDate ,POHEAD.Z_ArrivalTime ,POHEAD.Z_CountedDate ,POHEAD.Z_CountedTime ,POHEAD.PostStatus ,POHEAD.daterequired ,count(POLINE.ProductCode) ,count(POHEAD.quantityOrdered) FROM POHEAD JOIN POLINE ON POHEAD.DocumentID=POLINE.DocumentIDWHERE(POHEAD.Z_ArrivalDate <> '' and POHEAD.Z_CountedDate <> '' and POHEAD.Z_CountedDate >= :fromdate and POHEAD.Z_CountedDate <= :todatestatus = countedor POHEAD.Z_ArrivalDate <> '' and POHEAD.Z_CountedDate = '' and POHEAD.PostStatus = 'U' and POHEAD.QuantityReceipted = 0status = arrivedOR POHEAD.Z_ArrivalDate = '' AND POHEAD.daterequired BETWEEN :todate -10 AND (:TODATE))status = arrivedGROUP BY POHEAD.DocumentNo ,POHEAD.CreditorCode ,POHEAD.InternalReference ,POHEAD.QuantityOrdered ,POHEAD.Z_ArrivalDate ,POHEAD.Z_ArrivalTime ,POHEAD.Z_CountedDate ,POHEAD.Z_CountedTime ,POHEAD.PostStatus ,POHEAD.daterequired order by 7,8,5,6,10 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-06 : 04:08:36
|
sorry didnt get your actual requirement.Can you show some sample data and then explain what you want as output.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|
|
|