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 Chriss Miller 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 chamilz

  1. chamilz

    Can't get thousands seperator to work in SQL error

    SELECT ChgBillMonth ,CONVERT (VARCHAR(100),SUM(CAST(ChargeAmt as Money)),1) as ChargeAmt ,sum(CurrentBalance) as Balance ,sum(ChargeAmt) as ChargeAmtSum --,sum(CurrentBalance) as Balance FROM #T WHERE ChgBillMonth='8/1/2013' GROUP BY ChgBillMonth
  2. chamilz

    Scrape data between brackets - []

    select substring(YourColumn,charindex('[',YourColumn)+1, charindex(']',YourColumn)-charindex('[',YourColumn)-1) from YoutTable
  3. chamilz

    need help with SQL statement to get counts managers of managers of managers

    check this out... http://msdn.microsoft.com/en-us/library/ms186243%28v=sql.105%29.aspx
  4. chamilz

    Scrape data between brackets - []

    select substring(YourColumn,2,len(YourColumn)-2) from YourTable
  5. chamilz

    Adding Group Columns

    if it is SQL 2005, use CTE with Detail(empcount,busunitdesc) as ( select count (distinct employeeid), busunitdesc from invinvoicedetail inv inner join invinvoiceheader b on b.invoiceid = inv.invoiceid inner join ssbusunit u on u.busunitid = inv.busunit where b.invoicedate between @StartDate...
  6. chamilz

    Set Theory for beginning database developers?

    this book helped me to explore more behind the T-SQL http://www.amazon.com/Inside-Microsoft-SQL-Server-2005/dp/0735623139#readerhttp://www.amazon.com/Inside-Microsoft-SQL-Server-2005/dp/0735623139#reader
  7. chamilz

    Multi Part Identifier Could Not Be Bound

    in your derived table 'Month(dteEffectiveDate)' column has been defined as 'Monthy' and AVG(nbrFuelSurcharge) as 'FSCY'. run this code alone and see the output and columns SELECT 'Monthy'=Month(dteEffectiveDate), 'FSCY'=AVG(nbrFuelSurcharge) FROM Mother.dbo.tblFuelSurcharge GROUP by...
  8. chamilz

    Multi Part Identifier Could Not Be Bound

    ( SELECT 'Monthy'=Month(dteEffectiveDate), 'FSCY'=AVG(nbrFuelSurcharge) FROM Mother.dbo.tblFuelSurcharge GROUP by dteEffectiveDate ) AS tbl
  9. chamilz

    Convert Decimal to Int

    That was very informative George. I wasn’t sure that there is a workaround to convert data type using CASE so i thought that my logic was wrong. So i built that logic at the report level. Thanks for the suggestion.
  10. chamilz

    Convert Decimal to Int

    Thanks jbenson001 for pointing that error!!
  11. chamilz

    Convert Decimal to Int

    Hi, I want to format the data as below for a report. here is just a sample of what i am doing... create table #test (Header_1 varchar(20), Month_1 numeric(10,2)) ; insert into #test values('Sales',120) insert into #test values('Sales%',2.45) ; select case when charindex('%',[Header_1])=0...
  12. chamilz

    Strange Timeout expired error

    instead of ConnectionTimeOut = 0, try using CommandTimeOut=0 cmd.CommandTimeOut = 0 cmd.ExecuteNonQuery()
  13. chamilz

    Help with Min()/Grouping

    MikeBinKC, I think SQLSister explained it clearly. you can further read about derived table here.. http://www.sqlservercentral.com/articles/Performance+Tuning/derivedtablebasics/597/
  14. chamilz

    Help with Min()/Grouping

    try this... select a.EmployeeName, a.LeadName, a.PhoneNumberCalled, a.DateCalled from MyCallRecord a inner join ( select EmployeeName, LeadName, min(DateCalled)DateCalled from MyCallRecord group by EmployeeName,LeadName ) b on a.EmployeeName =...
  15. chamilz

    RE: Pivot Table ??

    this might help you. thread183-1459723

Part and Inventory Search

Back
Top