Forum Replies Created

Viewing 15 posts - 271 through 285 (of 366 total)

  • RE: setting default datetime

    If you are setting the default date in enterprise manager try using ("2005-1-1").

    HTH Mike

  • RE: Blank spaces on the left from string result of a query

    Hi the problem is that you have extra spaces to the right of good. Use rtrim. HTH Mike

    declare @word char(50)

    declare @anotherword char(50)

    set @word ='good'

    set @anotherword ='apple'

    Set

    print rtrim(@word) + ltrim(@anotherword)

    /*...

  • RE: SQL - Update related table

    Hi the following client side code (vb 6.0) will give you the results you want. Another thought is that since you must use row scans if you have a large...

  • RE: SQL - Update related table

    Lost another post and I have to run but

    Try this to get rid of exact matches first.

    HTH Mike 

    DECLARE payments_cursor cursor FOR

    SELECT *

    FROM PAYMENTS P

    INNER JOIN Bills b

    on b.amount =...

  • RE: SQL - Update related table

    It ate my post. The logic is not to bad you can use a bubble sort to find the values that are equal to...

  • RE: SQL - Update related table

    Question does the text file contain both new bills, and payments or just payments? What are the business rules for excess amounts since you do not record part payments (do...

  • RE: Nested JOIN''''s behavior

    Hi I can not reproduce your problem. checking in QA I get the same execution plans for both queries.

    Mike

    IF Object_ID('TempDb..#T1') >0

     DROP TABLE #T1

    IF Object_ID('TempDb..#T2') > 0

     DROP TABLE #T2

    IF Object_ID('TempDb..#T3')...

  • RE: SQL - Update related table

    This query will give you a running total of a customers account

    HTH Mike

    SELECT b.Account As Account#,

      Sum(DISTINCT b.Amount) as "Total Billed",

      Sum(DISTINCT P.Amount) AS "Total Payments",

     (Sum(DISTINCT b.Amount) -  Sum(DISTINCT P.Amount))...

  • RE: SQL - Update related table

    A couple of questions. Your example assumes that a payment will always equal a bill or the sum of several bills. What happens when a customer makes a partial payment....

  • RE: Date Manipulation / Update

    Raymond a quick question if the data is being updated daily as the rows are input then the Date field will be the current date and time that the row was...

  • RE: t-sql solutions needed

    I usually read all the post before adding to a thread. In this case I started developing a query and was interupted. Then when posting just glanced at Remi's Solution saw the ref...

  • RE: t-sql solutions needed

    "Like" will enable you to sort the data. Notice that like it is not case sensitive in finding strings.

    HTH Mike   

    DROP TABLE #Test

    IF Object_ID('TempDB...#Test')>0

     DROP TABLE #Test

    CREATE TABLE #Test

    (

     N VarChar(50)

    )

    INSERT INTO #Test...

  • RE: How to Determine Whole Dollar Amount

    Dan your

    SELECT *

    FROM Sales

    WHERE CAST(Amount AS int) = Amount does not return the correct data. Try the following

    HTH Mike

    CREATE TABLE #Test

    (

     pk int identity(1,1), 

     DecValue decimal(5,2)

    )

    INSERT INTO #Test VALUES(12.00)--HERE

    INSERT INTO #Test...

  • RE: Copy from a table then delete

    Place the declare statement after the AS

    CREATE PROCEDURE [dbo].[acsp_AC_PUNCHIMPORT_TO_AC_PUNCHIMPORT_TEMP]

    AS

    DECLARE @maxPunchID int

    HTH Mike

  • RE: picking the "best" row out of a set

    "Gee Joe do you mean that change is the only constant in the universe. What a thought.

    Mike

Viewing 15 posts - 271 through 285 (of 366 total)