Forum Replies Created

Viewing 15 posts - 6,286 through 6,300 (of 10,144 total)

  • RE: Subtract Value At Previous Row From Current Row

    HUSRAF (6/7/2012)


    I want to check End date is within 14 days of next row start date, If within 14 days than use first row start date and last row end...

  • RE: Subtract Value At Previous Row From Current Row

    HUSRAF (6/7/2012)


    Hi

    Can someone please help me with this?

    Raw Data

    ID StartDate DEP EndDate

    1 14/02/2011 A 14/02/2011 ...

  • RE: The Beer Cooler Thread

    anthony.green (6/11/2012)


    As Asda have a 2 for £3 deal on ale, I thought it would be rude of me not to pick up a few new ones to try and...

  • RE: Stored Procedure with dates

    Nidhi G (6/8/2012)


    Sorry If I was not able to provide the correct details. I read the article. and will take care of this in future.

    but coming back to my original...

  • RE: Building of Date is wrong

    Lynn Pettis (6/8/2012)


    michael vessey (6/8/2012)


    try the following

    declare @mydate datetime

    set @mydate=GETDATE()

    SELECT dateadd(dd,4,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,@mydate))-1),DATEADD(mm,1,@mydate)),101) )

    see Pinal Dave's blog post on these

    http://blog.sqlauthority.com/2007/05/13/sql-server-query-to-find-first-and-last-day-of-current-month/

    edit: the other suggestions are better than mine - i did a...

  • RE: Building of Date is wrong

    dwilliscp (6/8/2012)


    I can not seem to figure out what I did wrong.. this does not return any records...( trying to build a statement that will get the 5th day of...

  • RE: QUERY ERROR

    river1 (6/8/2012)


    ...

    CAN SOMEONE HELP?

    TKS

    Yes - always PRINT the string to see exactly what is generated by your code.

    Simple.

  • RE: How to add if condition within the Where clause :

    anthony.green (6/8/2012)


    Needs to become dynamic sql...

    Doesn't need to, but possibly better performance than the alternative:

    select * from test a

    inner join test1 b

    on a.id=b.module_id

    where a.id=@id

    and a.name=@name

    AND CONVERT(CHAR(8), a.start_dt, 112) <=...

  • RE: how to take sum of count for this selct proc?

    Can you write this query using JOINs instead of IN, which implies that you are unsure of the relative cardinality of the tables? Something similar to this perhaps:

    SELECT

    sub.SubCategoryId,

    sub.SubCategoryName,

    sub.CategoryId,

    SubCategorycount =...

  • RE: Duplicate Problem

    Stewart "Arturius" Campbell (6/8/2012)


    wertyui (6/7/2012)


    I want to get NextNo value and update NextNo for following case

    1 Type=1 or Type=2 Update NextNo = Max(NextNo)+1

    2 Type=3 Update NextNo = Max(NextNo)+2 (reserved...

  • RE: need help to simplify this script

    dwain.c (6/8/2012)


    ChrisM@Work (6/8/2012)


    dwain.c (6/5/2012)


    Just to show that I'm keeping current on SQL 2008 stuff, and probably for no other reason, I thought I'd post a less verbose alternative.

    SELECT Employee, NEW_LOB,...

  • RE: need help to simplify this script

    dwain.c (6/5/2012)


    Just to show that I'm keeping current on SQL 2008 stuff, and probably for no other reason, I thought I'd post a less verbose alternative.

    SELECT Employee, NEW_LOB, NEW_DEPARTMENT, NEW_COST_CENTRE,...

  • RE: The Beer Cooler Thread

    anthony.green (6/1/2012)


    I shall say this now before I forget, happy 4 day weekend to all in the UK, time to drink copious amounts of alcohol.

    Oh yes! You too Anthony.

    Three...

  • RE: Eliminating Duplicate Rows using The PARTITION BY clause

    prakashp 84206 (6/1/2012)


    Hi,

    The output of my query contains duplicate records (i.e. column1 value is similar but other column's value different) as well as single record having column2 value blanks(-). now...

  • RE: The Beer Cooler Thread

    John Mitchell-245523 (6/1/2012)


    I think frites have been adopted by Belgium as its own national delicacy. Indeed, there's a song in the Europop tradition (sung in English) called It's Great...

Viewing 15 posts - 6,286 through 6,300 (of 10,144 total)