Forum Replies Created

Viewing 15 posts - 1,291 through 1,305 (of 1,413 total)

  • Reply To: count number of days between two dates excluding weekends for a particular month

    Yea yea, I know or I noticed after I posted that.  Instead of eomonth() you could use:

    dateadd(day,-1,dateadd(month,1,@test_month))

    Then you could use a tally table and dateadd function.  Or...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: count number of days between two dates excluding weekends for a particular month

    This is an application for Jonathan's daterange function.  Here is his article:

    https://www.sqlservercentral.com/scripts/a-daterange-table-valued-function

    Something like this:

    declare
    @input_yearint=2019,
    @input_monthint=9;
    declare
    @test_monthdate=datefromparts(@input_year,@input_month,1);

    select
    count(*) days_in_month_excluding_wkends
    ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Checking if a value has been set/changed in week/month from audit table

    robtyketto wrote:

    I'm thinking of check where the status is that of 12 as in the example for a month period, this is done via a mechanism of a table that...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Viewing 15 posts - 1,291 through 1,305 (of 1,413 total)