DATEDIFF two dates 1 year apart

For a friend who needed to know how to check if two dates in Sybase ASE 12 are a year apart. A JavaScript Solution Add moment.js lib // TODO: Validate if date diff is no more than 1 year var startSepDt = moment($(‘#startDateSep’).val()); var endSepDt = moment($(‘#sendDateSep’).val()); var dateDiff = endSepDt.diff(startSepDt, ‘year’); if (dateDiff > 1)  {        showInValidSeasrchWarning(‘The date range cannot exceed a year.’);        return false; }   A SQL Solution — DATEDIFF two dates 1 year apart DECLARE @year1 datetime, @year2 datetime SET @year1 = […]

Android Nano Degree resources

Read your first Android blogpost article Start by reading this post on the Android Developers blog. It’s written by Google Design Advocate, Roman Nurik, who was the lead designer on the Google I/O 2014 app. Google I/O is an annual conference that Google holds for developers. Follow official Android Development channels on social media Aside from the […]

Visual Studio 2017 JQuery, WebPack and .Core

http://leruplund.dk/2017/04/15/setting-up-asp-net-core-in-visual-studio-2017-with-npm-webpack-and-typescript-part-i/   The CLI moved into a separate package: webpack-cli. Please install ‘webpack-cli’ in addition to webpack itself to use the CLI. -> When using npm: npm install webpack-cli -D -> When using yarn: yarn add webpack-cli -D https://github.com/FormidableLabs/webpack-dashboard/issues/97   (Make sure you deleted the bundle.js file to ensure your task runner is executing correctly) […]

Dynamic Search Conditions in T‑SQL

I hate dynamic querys as they are not optimized and a query plan cannot be cached…. Example: Sql = some dyanamic sql string built via if logic… Exec(sql) – will not cache an query execution plan. In MS Sql   sp_executesql caches query plans – very cool… Really though, try to avoid them if possible….   […]