Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by sabinUE

  1. sabinUE

    Update records based on Count

    OR SELECT ERP.ERP_Line_Num ,ERP.Item ,A.[Count] FROM ERP INNER JOIN (SELECT ERP_Line_Num ,COUNT(ERP_Line_Num) AS [Count] FROM ERP GROUP BY ERP_Line_Num) AS A ON ERP.ERP_Line_Num = A.ERP_Line_Num sabin MCP
  2. sabinUE

    Update records based on Count

    Hi, ;with ERP (ERP_Line_Num, Item) AS (select '001','0083104' union all select '001','0210901' union all select '002','0049703' union all select '003','0049806') SELECT ERP_Line_Num , Item ,COUNT(ERP_Line_Num) OVER(PARTITION BY ERP_Line_Num ORDER BY ERP_Line_Num ASC) AS [Count]...
  3. sabinUE

    Help Writing a complicated query

    Welcome! sabin MCP
  4. sabinUE

    Help Writing a complicated query

    ;with Users (UserID,UserName,GroupID) AS (SELECT 1 ,'Joe',3 UNION ALL SELECT 2 ,'Dave',5 UNION ALL SELECT 3 ,'Geoff', 2 UNION ALL SELECT 4 ,'Gordon', 1 UNION ALL SELECT 5 ,'Jane', 4 ) ,Groups (GroupID,GroupName) AS (SELECT 1,'Group1' UNION ALL SELECT 2,'Group2' UNION ALL SELECT...
  5. sabinUE

    modifying table structure

    Hi, ;with aCTE AS ( select 'test1' modelno,'scratch' defect_type,10 qty union all select 'test2','dent', 5 union all select 'test3','deform', 20 ) select * from aCTE pivot(SUM(QTY) FOR modelNo in ([test1],[test2],[test3])) PV Order by defect_type desc and the output: defect_type...
  6. sabinUE

    Unicode data, stored procedure and SQL Server 2000

    I are right; sry about that sabin MCP
  7. sabinUE

    Unicode data, stored procedure and SQL Server 2000

    Hi, Try to use SqlDbType.NVarChar instead of adVarChar sabin MCP
  8. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    Hi, Glade to help! Have a nice day also! Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut sabin
  9. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    Hi, I hope that now it's ok. S Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut sabin
  10. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    run this: select t0.SupplierName,t0.Dscription from dbo.Paul_MOBA_History_SB as t0 WHERE t0.SupplierName like '%Berkana%' GROUP BY t0.SupplierName,t0.Dscription and this: select t0.SupplierName,t0.Dscription from dbo.Paul_MOBA_History_SB as t0 where t0.FirstDate >= @FromDate and...
  11. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    It's possible that , in view/table dbo.Paul_MOBA_History_SB, the value for FirstDate is null? - add another column to those select : select ..., 1 as express union all select ....,2 to be able to find from where is coming those rows (first select or second select) depending of what result...
  12. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    I've made some adjustments to the query can we see the adjustments ? Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut sabin
  13. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    u can drop the where condition :AND t0.SupplierName like '%Berkana%' from both selects Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut sabin
  14. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    Yes, you can try it S Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mut sabin
  15. sabinUE

    If data exists in view return data otherwise return 1 percent for each farm & egg type

    declare @FromDate as DATE ,@ToDate as DATE SET @FromDate=CONVERT(date, DATEADD(d,-7,getdate())) SET @ToDate=CONVERT(date, getdate()) ;with Farm AS (select 'Berkana Park' as SupplierName, 'Blood' as Dscription ,0 as EggPercent ,'2014-03-15' as FirstDate union all select 'Berkana...

Part and Inventory Search

Back
Top