Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 2,452 total)

  • RE: Get previous row's value - with a twist!

    CASE WHEN DATENAME(dw , MAX(Date)) = 'Friday' THEN DATEADD(day , 3 , MAX(Date))

    ELSE DATEADD(day , 1 , MAX(Date)) END as Date

    edit...corrected typo

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Get previous row's value - with a twist!

    mm7861 (11/17/2015)


    Thanks Drew, out of curiosity why do you think LAG is not best for the job? I tried the LAG version and your version and the LAG version runs...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Recent Form Football standings ( for example Last 5 games standings )

    g.debrucker (11/16/2015)


    Yes the sql code to get this out of my database would be much apreciated.

    Probably I will use MySQL in the future so If you could help me with...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Recent Form Football standings ( for example Last 5 games standings )

    g.debrucker (11/16/2015)


    Hi all,

    I'm very new to SQL and MS-Access. But My hobby is driving me to databsetools 🙂 I collect every soccer game around europe but my excelsheet can't handle...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Get previous row's value - with a twist!

    maybe a start

    WITH CTE

    AS (

    SELECT

    DATEADD(day , 1 , MAX(Date)) AS Date

    , Asset_ID

    ,...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: MS Access 2013 FE - #10054 'Connection Forcibly Closed by Remote Host' - SQL Server 2012

    similar problem here....with a possible solution

    http://www.sqlservercentral.com/Forums/Topic1704338-1550-1.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate daily turnover in SQL Server 2008

    here is one way....this should get you started.....

    SELECT

    CONVERT(varchar(10) , TimeOut , 101) AS yourdate

    , SUM(CASE

    WHEN DATEPART(hour , timeout) >= 12

    ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate daily turnover in SQL Server 2008

    mrbill.mt (11/14/2015)


    J Livingston SQL (11/14/2015)


    mrbill.mt (11/14/2015)


    I have the following data:

    I have to count data from date A to Date B (e.g: 11/1/2015 to 11/3/2015) and From Hour to Hour (e.g:...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate daily turnover in SQL Server 2008

    mrbill.mt (11/14/2015)


    I have the following data:

    I have to count data from date A to Date B (e.g: 11/1/2015 to 11/3/2015) and From Hour to Hour (e.g: From0_12: From 0:00 to...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Update using Case Statement

    nexus2vijay (11/12/2015)


    Thanks for the revert Bossman.

    I'm not a Techie infact. I'm from Teaching field and new to IT industry and getting to know the DB.

    If you could help me out...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Update using Case Statement

    nexus2vijay (11/12/2015)


    Hi,

    From the attached 4 Tables Schema Diagram

    Will the below query Reduce me the ListPrice by 20% if i didn't receive the order for the last 2 years ? Jammed...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: 4 Queries Required Very Urgent

    nexus2vijay (11/12/2015)


    Hi,

    It's a test actually.

    Nope infact i don't have setup to test the same. I have just given the logical approach.

    Appreciate if you could help me with that sir.

    Vijay

    A "test"...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: 4 Queries Required Very Urgent

    homework I assume?

    have you actually set up some sample tables and data and run your answers to see if they are correct?

    or are you looking for any easy way out?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: tsql query help

    think the following will help us all.....please read and post accordingly.

    thanks

    http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Are the posted questions getting worse?

    Luis Cazares (11/2/2015)


    Eirikur Eiriksson (11/2/2015)


    Lynn Pettis (11/2/2015)


    SQLRNNR (10/31/2015)


    For thread posterity:

    It was awesome to get to meet some of the denizens of The Thread last week. Too bad Jeff Moden...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 991 through 1,005 (of 2,452 total)