Forum Replies Created

Viewing 15 posts - 4,891 through 4,905 (of 10,144 total)

  • RE: SQL /Procedure - for Transpose and Calculation

    Is there one payment type which is common to all employees? For instance, 'SAL'? This could be very easy ...

  • RE: split single row into four rows.

    abhas (4/9/2013)


    Thanks matak.

    I will try this.But my actual requirement is to insert this data into table after selecting from front end dropdown. for example if user selects date like 2012/03/23...

  • RE: Add date range by record line

    Try this rough and ready method. It's quick and simple to change. If you can make it work then there's a better algorithm described in this excellent article [/url]by Gabriel...

  • RE: CASE statement

    Use APPLY to construct a value which can then be used in the WHERE clause. This code chunk may well be incorrect - as Orlando's pointed out, some of the...

  • RE: split single row into four rows.

    Can you post ddl and dml for your source table please? If you're not sure how to do this, have a read of the link in my sig.

  • RE: Slows system performance

    Your transaction log is currently too small to accommodate logging of the changes you are making to your tables in this series of statements.

    Check which recovery model are you...

  • RE: WHERE > CASE > IN

    lanky_doodle (4/8/2013)


    Thanks both. Although I didn't exactly copy/paste, with the guidance above this is what works for me;

    WHEREUser_ID = xxxx

    AND MONTH(Date) = xxxx

    AND (MONTH(GETDATE()) < 12 AND YEAR(Date) = YEAR(GETDATE())

    OR...

  • RE: auto foreign key generation

    SDG1 (4/8/2013)


    No Duplicates

    (0 row(s) affected)

    Table '#PivotedSourceTable

    The ProjectID field does not seem to be the issue. The PK_Test_ELE_761abed01e1455b5 field that shows up under the key folder (see original post screen...

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

    How often we see "so how does that work, exactly?" when someone posts an up-to-date solution to their tricky problem. Try explaining this algorithm in the remaining 3 minutes of...

  • RE: WHERE > CASE > IN

    lanky_doodle (4/8/2013)


    The thing is I only want it to include the next year if the current month is 12.

    So if the current month is Jan-Nov only take dates from this...

  • RE: auto foreign key generation

    -- run the results into a #temp table and check for dupes:

    select

    Field1 AS ProjectID, --

    Field2 AS ParcelID,

    UKEY,

    Full_Address as Location,

    Field3 as AppStatus,

    Field4 as AppStatusDate,

    Field5 as [Type],

    Field6 AS Category,

    [Community Number]...

  • RE: WHERE > CASE > IN

    -- try using SARGable ranges instead of non-SARGable functions on your columns:

    SELECT *

    FROM (SELECT ABR_Shift_Date = GETDATE()) abr

    CROSS APPLY (

    SELECT

    ThisyearLower = DATEADD(month,DATEDIFF(MONTH,0,GETDATE()),0), -- 1st April this year

    ThisyearUpper = DATEADD(month,2+DATEDIFF(MONTH,0,GETDATE()),0),...

  • RE: Inserting missing records using multiple fields as the key

    Does this help?

    -- set up some sample data

    DROP TABLE #Contracts

    CREATE TABLE #Contracts (ID INT IDENTITY, Contract_Description VARCHAR(50), StartDate DATETIME)

    DROP TABLE #Sections

    CREATE TABLE #Sections (ID INT IDENTITY, Section VARCHAR(50))

    DROP TABLE...

  • RE: check condition

    kapil_kk (4/8/2013)


    Hi all, I have to check a condition that if I entered correct first and last voucherno then only it have to perform some operation like insertion.... But I...

  • RE: Are the posted questions getting worse?

    rodjkidd (4/8/2013)


    ChrisM@Work (4/5/2013)


    rodjkidd (4/5/2013)


    Steve Jones - SSC Editor (4/5/2013)


    Cadavre (4/5/2013)


    rodjkidd (4/4/2013)


    Hotel booked for SQLBits. Almost forgot all about that so a nice refreshing 20 minute walk in the morning!

    I'm in...

Viewing 15 posts - 4,891 through 4,905 (of 10,144 total)