does DATEFROMPARTS() work in 2016?

  • am working in dev environment sql server 2012. Need to create a date from 'snapshot month' (6) and 'snapshot year' (2016). Found DATEFROMPARTS() function works but wondering if that will continue to work into the future if prod goes 2016.

    eg.

    DATEFROMPARTS (snapshotyear, snapshotmonth, 1) makedatefromparts

    --Quote me

  • polkadot (8/13/2016)


    am working in dev environment sql server 2012. Need to create a date from 'snapshot month' (6) and 'snapshot year' (2016). Found DATEFROMPARTS() function works but wondering if that will continue to work into the future if prod goes 2016.

    eg.

    DATEFROMPARTS (snapshotyear, snapshotmonth, 1) makedatefromparts

    works for me in

    Microsoft SQL Server 2016 (RTM) - 13.0.1601.5 (X64) Apr 29 2016 23:23:58 Copyright (c) Microsoft Corporation Developer Edition (64-bit) (Build 10586: )

    declare @snapshotyear int = 2016

    declare @snapshotmonth int = 6

    SELECT DATEFROMPARTS (@snapshotyear, @snapshotmonth, 1) makedatefromparts

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

  • thanks for checking.

    --Quote me

  • https://msdn.microsoft.com/en-us/library/hh213228.aspx

    Pertenant part:

    THIS TOPIC APPLIES TO: SQL Server (starting with 2012)

    , and there't no "This feature is deptecated" block at the top

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I failed to mention how I'd checked etc.

    Usually all versions are listed in drop down, so it's inconsistent for them to only list 2012, and lack of deprecated doesn't mean it's not. Gail - I guess you believe in the infallibility of Microsoft.

    --Quote me

  • polkadot (8/14/2016)


    Usually all versions are listed in drop down, so it's inconsistent for them to only list 2012

    That's the previous version of MSDN. It's been changed (though spme of the pre-2012 pages are still floating around) They now list the version the feature was added in, as well as whether it works in Azure SQLDB, Azure SQLDW or PDW and whether it's deprecated or not. There's too many versions and forms of SQL to have seperate pages for the same feature for each version.

    And seeing as I've reported a whole pile of docs bugs over the last year, no I don't expect MS to be infallibil, but they do correct the docs quickly when things are wrong, and stuff that's deprecated does get flagged.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply