Forum Replies Created

Viewing 15 posts - 5,611 through 5,625 (of 10,144 total)

  • RE: Are the posted questions getting worse?

    Sean Lange (9/19/2012)


    Brandie Tarvin (9/19/2012)


    Lynn Pettis (9/19/2012)


    Do you ever feel that no matter how many times you tell someone what the problem may be that they just aren't listening?

    Yep.

    My current...

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/19/2012)


    ...

    No,Chris, When the Acc No's Open_balance is null Between the date only change the sql query to before 16-09-12...

    how to do that?

    Use ISNULL or COALESCE in the output set.

  • RE: Fuzzy-String Search: Find misspelled information with T-SQL

    Thomas Keller (9/19/2012)


    @chrism-2@Work: Interesting approaches, but I'm wondering why you use DATALENGTH instead of LEN, are you trying to include trailing spaces? (In order to work with NVARCHAR instead of...

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/19/2012)


    ChrisM@Work (9/19/2012)


    chinye2020 (9/19/2012)


    ...

    This work perfectly like the CTE, well done, but, how to edit sql query only show AccNo <> 1 ??

    ...

    Easy - but first, we need to sort...

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/19/2012)


    ...

    This work perfectly like the CTE, well done, but, how to edit sql query only show AccNo <> 1 ??

    ...

    Easy - but first, we need to sort out your...

  • RE: Datatype truncation

    Sean Lange (9/19/2012)


    ChrisM@Work (9/19/2012)


    Sean Lange (9/7/2012)


    ChrisM@Work (9/7/2012)


    sqlnaive (9/7/2012)


    For such kind of reasons we should avoid float and real datatypes ? And rather use decimal and numeric ?

    Have a look in...

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/19/2012)


    ...

    DONE!

    That's not opening and closing balance - it's simply the amounts of the first and last transactions in the date range.

    SELECT

    a.AccNo,

    t.Total_Adjustment,

    t.Total_Topup,

    t.Total_Comm,

    t.Total_Transfer,

    t.Total_RecvTransfer,

    t.Total_Maxis,

    t.Total_Digi,

    t.Total_Celcom,

    Option3.Open_Balance + t.TransactionsForPeriod AS ClosingBalance

    FROM Tbl_Account a

    LEFT JOIN...

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/19/2012)


    ...

    DONE !, this is select Top 1 Amount,But how to select the LAST Amount as Closing_Balance?

    Performance will be very poor. What datatype is Tbl_Transaction.Transaction_Date?

  • RE: Sum with Multi Category and Group By Acc No ?

    SELECT

    a.AccNo,

    SUM( case when t.TransType_ID = 0 then t.Amount else 0 end ) as Total_Adjustment,

    SUM( case when t.TransType_ID = 1 then t.Amount else 0 end ) as Total_Topup,

    SUM( case when...

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/19/2012)


    i mean select the top 1 Amount in the sql query

    Ordered by what? Amount? Transaction date?

  • RE: Fuzzy-String Search: Find misspelled information with T-SQL

    Interesting article and well worth a second read, and a play with the code.

    I've used two TSQL fuzzy-matching algorithms in the past, both work "well enough" - subjective and also...

  • RE: Today's Random Word!

    L' Eomot Inversé (9/15/2012)


    capnhector (9/14/2012)


    supercalifornication?

    Or supercalifellation?

    Sounds like a turkey.

  • RE: Sum with Multi Category and Group By Acc No ?

    chinye2020 (9/18/2012)


    ...(SELECT Top 1 Amount as Open_Balance)<<---how to do this at here?i want to get the first Amount as Opening Balance

    ...

    Write a separate query for this, then integrate it into...

  • RE: Variable String + Variable

    samtwilliams (9/19/2012)


    Can anyoen help with this.

    Thanks

    DECLARE @variable varchar(100), @command VARCHAR(500)

    SET @variable = 'E:\MyData\Target\CSV'

    SET @command = N'Exec dbo.pReport_Update_Unit ''' + @variable + ''''

    SELECT @command

  • RE: Datatype truncation

    Sean Lange (9/7/2012)


    ChrisM@Work (9/7/2012)


    sqlnaive (9/7/2012)


    For such kind of reasons we should avoid float and real datatypes ? And rather use decimal and numeric ?

    Have a look in BOL under CONVERT...

Viewing 15 posts - 5,611 through 5,625 (of 10,144 total)