Forum Replies Created

Viewing 15 posts - 1,876 through 1,890 (of 10,144 total)

  • RE: Need Help SQL Query

    dprasannain (12/10/2015)


    Why doesn't this query return's any value . Whats wrong with this query

    Select * from #emps Where EN IN (@Names)

    - because @Names isn't the comma-delimited list of string values...

  • RE: Need Help SQL Query

    dprasannain (12/10/2015)


    Hello Experts,

    I have a table with EmployeeNames as below which is a varchar column

    EmployeeNames

    ---------------

    A

    B

    C

    D

    How do i get the output as 'A','B','C','D' using coalesce function. Kindly help

    Is the use of...

  • RE: How to pad a string with spaces when size of data is unknown

    Jeff Moden (12/9/2015)


    ChrisM@Work (12/9/2015)


    suvesh.sonker 2691 (12/9/2015)


    -- Ten digit

    Declare @field as varchar(20) = '559'

    Select Replace(right(replicate(' ',10) + @field ,10),' ','0')

    In what circumstances might this be preferable to the simpler SELECT RIGHT('0000000000'+@field,10)?

    When...

  • RE: How to get sql to work out the amount of hours worked

    hazeleyre_23 (12/10/2015)


    Hi,

    thank you for your reply.

    I have a start roster date however if someone works 21:00 - 06:00 then I need the date date to change to the next day.

    i.e...

  • RE: How to pad a string with spaces when size of data is unknown

    suvesh.sonker 2691 (12/9/2015)


    -- Ten digit

    Declare @field as varchar(20) = '559'

    Select Replace(right(replicate(' ',10) + @field ,10),' ','0')

    In what circumstances might this be preferable to the simpler SELECT RIGHT('0000000000'+@field,10)?

  • RE: SELECT 1 random row query help, please

    serg-52 (12/9/2015)


    Most probably there were a lot of DELETEs an INSERTs on a table with 1million+ rows. So IDs hardly are evenly distributed on (1 .. count(*)) interval or even...

  • RE: SELECT 1 random row query help, please

    Aditya Daruka (12/8/2015)


    Here is something to play with

    DECLARE @T TABLE (Id INT IDENTITY(1,1) PRIMARY KEY, CategoryId INT NULL, SKU VARCHAR(60) NOT NULL)

    INSERT INTO @T ( CategoryId, SKU)

    SELECT 3200, '978-654-321' UNION...

  • RE: A Simple Formula to Calculate the ISO Week Number

    chill-1062987 (12/8/2015)


    Thank you I did manage to take a good run at this but feel I have fallen short on the result. I know there is some better way to...

  • RE: A Simple Formula to Calculate the ISO Week Number

    Interesting...but have a play with this, which could be converted into an inline table-valued function:

    -- SET DATEFIRST 7 = SUNDAY

    SELECT DATENAME(DW,'18991231') -- sunday

    -- count the number of whole weeks between...

  • RE: how to calculate percentage on based on column values

    -- Set up sample data

    WITH Sampledata AS (

    SELECT *

    FROM (VALUES

    (1, 'A', 'A', 'C', 'B', 'B', 'B', 'A', 'C', 'D'),

    (2, 'B', 'A', 'C', 'A', 'C', 'A', 'A', 'B', 'B'),

    (3,...

  • RE: How to add hours in SQL query

    axaeffect 37346 (12/4/2015)


    Hi,

    I'm querying cube my last update like this :

    SELECT [CATALOG_NAME], [CUBE_NAME], [LAST_DATA_UPDATE]

    FROM $System.MDSCHEMA_CUBES

    I intend to add 8 hour to column LAST_DATA_UPDATE,

    using DATEADD like this

    SELECT [CATALOG_NAME], [CUBE_NAME],...

  • RE: Read articles without requiring login

    Sean Lange (12/3/2015)


    At one point it was discussed to allow anonymous people to read articles. What happened with that idea? There are plenty of times I would like to share...

  • RE: Calculating Duration Using DATETIME Start and End Dates (SQL Spackle)

    Occasionally there's a requirement for elapsed time as years, months, days, hours, minutes, seconds and milliseconds, such that if you were to add all of these time fractions to the...

  • RE: Left Join not providing the output as expected

    Shouldn't you be left-joining data to events?

  • RE: Are the posted questions getting worse?

    TomThomson (12/1/2015)


    Ed Wagner (12/1/2015)


    GilaMonster (12/1/2015)


    Ed Wagner (12/1/2015)


    They appear to have a one-shot use though, before disappearing to somewhere else.

    Probably something to do with collapsing the quantum mechanical wave function. Using...

Viewing 15 posts - 1,876 through 1,890 (of 10,144 total)