Forum Replies Created

Viewing 15 posts - 976 through 990 (of 3,957 total)

  • RE: Merge SQL Query help....

    rocky_498 (12/24/2013)


    I am 100% agree what you are saying, however its really hard for us to fix this problem, due to lot of restrictions or human entries...

    Any Code advise...

  • RE: Merge SQL Query help....

    pietlinden (12/23/2013)


    Your field sizes and some of the types are a bit over the top.

    DOB NVARCHAR(50)? Makes doing date math really hard.

    ID NVARCHAR(50)? Can't you use...

  • RE: Merge SQL Query help....

    And saying that it is "hard to stop" in the front end is simply not true. Try running the following:

    CREATE TABLE #Table1

    (

    ID NVARCHAR(50),

    FName NVARCHAR(50),

    LName NVARCHAR(50),

    DOB NVARCHAR(50),

    Active bit,

    PRIMARY KEY (FName,...

  • RE: Merge SQL Query help....

    rocky_498 (12/24/2013)


    That's a bad data the user is entering and its hard for stop, that's why i am merging through first/last and DOB.

    One of the main points of an application...

  • RE: Merge SQL Query help....

    I'm afraid your response still leaves a lot of open questions, so I guess I'm just going to need to give you a general answer.

    When you do the first UPDATE...

  • RE: Split a variable length string without using a WHILE loop

    Jeff Moden (12/24/2013)


    Well, if you had used the fn_Tally function I wrote for you, you wouldn't be in such a pickle

    That took more than a minute to sink in but...

  • RE: Are the posted questions getting worse?

    Merry Christmas to all!

    And may your New Years be filled with new learning opportunities, lasting relationships, new friends, good health and prosperous ventures.

  • RE: Xmas Transitivity Puzzle

    What if there are overlaps in your groups?

    How will you maintain the group number in the event your underlying data changes?

  • RE: Finding Overlapping Start and End Time Values

    I tend to shy away from self-joins on tables because I've found when they have many rows performance can be problematic.

    You might want to try this instead:

    SELECT EmployeeId, LocationId, ActualStartDate,...

  • RE: Merge SQL Query help....

    rocky_498 (12/23/2013)


    --Insert Table1

    Insert into Table1 (ID,FNAME,LName,DOB)

    VALUES ('1','Smith','Tom','12/12/2011')

    Insert into Table1 (ID,FNAME,LName,DOB)

    VALUES ('2','Smith','Tom','12/12/2011')

    --Insert Table2

    Insert into Table2 (ID,PID,PHONE,Address)

    VALUES ('1','101','5178896566','Test Ave')

    -- Insert Table3

    Insert Into Tbale3

    VALUES ('101','Active Order')

    -- Here is my question....

    I am Creating a...

  • RE: minimum Time-In and Time-Out Date based on user and Date.

    They say at Christmas it is better to give than to receive.

    So I will give you back your sample data in a manner that is consumable and thereby the helpers...

  • RE: rollup with 1stdayofmonth, lastdayofmonth for yearly report

    Looks to me like if you want to get your months as columns, you'll probably need to use a Cross tab query.

    Perhaps the clue that you seek is in one...

  • RE: Problems to learn...

    Here's a link to get you started on Gaps and Islands.

    The SQL of Gaps and Islands in Sequences [/url]

    It's a pretty advanced topic though so some of the links provided...

  • RE: Split a variable length string without using a WHILE loop

    Certainly no need to use a WHILE loop here. This should do it for you:

    WITH SampleData (MyStr) AS

    (

    SELECT '12345678'

    UNION ALL SELECT...

  • RE: sum of columns based on new group

    Brilliant Jeff, simply brilliant!

Viewing 15 posts - 976 through 990 (of 3,957 total)