Sabtu, 20 April 2019

how to save database connections

how to save database connections

Add Toolbar Menu Using Codejock Component

Add Toolbar Menu Using Codejock Component

Rabu, 17 April 2019

Membuat Kode Otomatis pada VB SQL Server

Membuat Kode Otomatis pada VB SQL Server

Jumat, 04 November 2016

Work around for calculating age using the SQL Server DateDiff function


Problem

Have you ever wanted to compute age, but the results from the DATEDIFF function seemed to be wrong some of the time? In this tip we cover why the DATEDIFF function does not always reliably compute age?

Solution

The SQL Server online documentation describes how to compute the number of datepart boundary crossings between two dates and/or times with the DATEDIFF function. The documentation indicates you can specify many different types of boundary crossings, such as borders betweens years, quarters, months, days of a year, a month, or a week. If you do not think about this much, you might conclude that boundary crossings for years correctly reflects the duration in years between two dates or datetime values. This would be a mistake.
This tip explains why the number of year boundary crossings does not reliably compute the duration between two dates or datetime values. The tip also applies this understanding to reliably computing the age in years between two date values, such as a birthdate and a hospital admission date .

Date and Time Conversions Using SQL Server


Problem

There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you.