Forum Replies Created

Viewing 15 posts - 826 through 840 (of 2,452 total)

  • RE: Add working days based on another field value - Help Needed

    try a search on this site ....plenty of q/a's

    GOOGLE> site:http://www.sqlservercentral.com add working days

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

  • RE: Add working days based on another field value - Help Needed

    K430 (4/7/2016)


    Thanks for the reply, I need it to add working days, skipping weekends

    so...other than weekends, what other days do you wish to skip...for example public holidays?

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

  • RE: Need Link for Developer edition

    https://blogs.technet.microsoft.com/dataplatforminsider/2016/03/31/microsoft-sql-server-developer-edition-is-now-free/

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

  • RE: Add working days based on another field value - Help Needed

    maybe....

    SELECT CharField,

    DateField,

    CASE

    WHEN CharField = 'A' then dateadd(day,14, datefield)

    WHEN CharField = 'B' ......... else NULL end as yournewdate

    FROM ...

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

  • RE: You are a SQL Server developer who is...

    Ed Wagner (4/6/2016)


    Alan.B (4/6/2016)


    Luis Cazares (4/6/2016)


    Ed Wagner (4/6/2016)


    Iwas Bornready (4/6/2016)


    This is great. I didn't know this simple trick.

    This is a QOTD that's 3 1/2 years old.

    And this functionality is no...

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

  • RE: Count patterns of behaviour in a certain order

    ChrisM@Work (4/6/2016)


    J Livingston SQL (4/6/2016)


    would be appreciated if the OP would reply, rather than logging on and not making any further comment.

    heyho!

    Counting patterns of unexpected behaviour in a certain order,...

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

  • RE: Count patterns of behaviour in a certain order

    would be appreciated if the OP would reply, rather than logging on and not making any further comment.

    heyho!

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

  • RE: Change Order of Week Names to Show Current Data First

    what is the data type of "week"?

    maybe if "week" is varchar then

    ORDER BY cast(week as int) DESC

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

  • RE: Count patterns of behaviour in a certain order

    as a starter.....given the following what results would you expect?

    if this isnt a basic interpretation of your table, then please post a representative script that does explain your table structure

    USE...

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

  • RE: Count patterns of behaviour in a certain order

    pbo71465 (4/3/2016)


    Thanks Hugo,

    I'm just looking for the logic to count patterns of action in a sequence.

    If you're not aware of any, then thanks for your contribution.

    I'm thinking someone has come...

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

  • RE: Help with logic

    curious_sqldba (4/1/2016)


    I have a table which stores Databasename and sizes. I want to be able to assign group numbers to set of database on fly based on there size.

    DBName ...

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

  • RE: Help with Dates

    Jacob Wilkins (4/1/2016)


    This seems to do what you want:

    DECLARE @dt datetime;

    SET @dt='20160331 14:38:25';

    SELECT date_from=DATEADD(mi,(((DATEDIFF(mi,0,@dt)/30)-2)*30),0),

    date_to= DATEADD(ss,-1,DATEADD(mi,(((DATEDIFF(mi,0,@dt)/30)-1)*30),0));

    SET @dt='20160401 12:02:25';

    SELECT date_from=DATEADD(mi,(((DATEDIFF(mi,0,@dt)/30)-2)*30),0),

    ...

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

  • RE: Help with Dates

    bit convoluted.....may be easier ways

    SELECT thedate,

    CAST(LEFT( DATEADD(hour,-1, DATEADD(minute, -DATEPART(minute, thedate) % 30, thedate)), 19) AS DATETIME) AS dtFrom,

    ...

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

  • RE: Weekly and Monthly Dates

    maybe a few ideas to get you started

    SELECT thedate,

    DATENAME(dw, thedate),

    DATEADD(wk, DATEDIFF(wk, 0, DATEADD(dd, -1, thedate)), 0)...

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

  • RE: Nested Joins - Having syntax and bounding issues

    still waiting for some sample scripts....are these on the way?

    does your "sales" table have multiple entries for same employee? (I am guessing yes??)

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

Viewing 15 posts - 826 through 840 (of 2,452 total)