Forum Replies Created

Viewing 15 posts - 1,561 through 1,575 (of 2,171 total)

  • RE: How to generate duplicate records!

    DECLARE

    @rInv TABLE (RoomInventoryID int, Rate numeric(10,2


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: TSQL question with Datediff

    WHERE crt_expiration_date < DateAdd(day, datediff(day, 31, current_timestamp), 0)

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Duplicate entries with unmatching related data

    Have you tried this?

     

    CREATE

    TABLE #TMP

    (

    RecID INT


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Cross tab SQL.

    Thanks.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Cross tab SQL.

    No, because MonthX is denoted how many months back the data is.

    Look at the sample data. THe data for June is in column Month1, and the data for January is...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Compare two varchar arrays one character at time until different

    Here is a nice function that works for up to 8 characters!

    CREATE

    FUNCTION dbo.fnFirstDifference

    (

    @FirstString


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Cross tab SQL.

    DECLARE

    @myTable TABLE

    (

    DataDate

    DATETIME,

    TotalCount

    INT,

    Count10s

    INT,


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Random Record Selection

    I have used it in a Call Center application. The company just wouldn't accept the possibility that an agent phoned a lead on the same street twice or more sequentially.

    The lead lists...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Using Rank over function

    something similar to this

    declare

    @sample table (id tinyint, [group] char(


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Date conversion

    It depends on the SET DATEFORMAT setting.

    If unsure, always use ISO date format YYYYMMDD or YYYY-MM-DD.

    In your case, since SQL Server cannot interpret last string as ISO, it tries MDY...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: From Table to Cross-tab style

    declare

    @sample table (year char(2), incdno tinyint


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: string comparison problem

    Post some sample data for both tables. Also provide expected output.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Case Statement in an Insert clause

    Yes, of course you can.

    Did you receive an error when you tried?

    If unsure, you can always start a transaction, execute statement, read uncommitted records and if satisfied, commit transaction.

     


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: sorting an alphanumeric field

    Well done!

    But beware that ISNUMERIC is not always trustworthy.

    select

    isnumeric('1E1'), ISNUMERIC('1D1')

    both returns 1.

    That's why I wrote my...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Count Distinct

    Please post your query.

    A correlated subquery with count may return no records, but the result should be zero in that case.

     


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 1,561 through 1,575 (of 2,171 total)