Oracle – Easy Date Strings (and NOT)

Whenever I type in a date strings in Oracle, I convert the strings to Date data type in my code as well as my queries without relying on the session setting for date format. I will explain why. Session date format setting: Session date format settings govern how date strings should be converted into dates (the … Continue reading Oracle – Easy Date Strings (and NOT)

Hard-coding Values In SQL Code – Please Don’t

What is hard-coding? Wikipedia defines it as below Hard coding (also, hard-coding or hardcoding) refers to the software development practice of embedding what may, perhaps only in retrospect, be regarded as input or configuration data directly into the source code of a program or other executable object, or fixed formatting of the data, instead of … Continue reading Hard-coding Values In SQL Code – Please Don’t

SQL Server – Calculating Business Days Between Two Dates (With Holiday Exclusion)

Note: The post is the same as the previous one for Oracle but this is for SQL Server. Although the date arithmetic gets a little complicated by the SQL Server syntax, the concept is the same. If you search the web on how to calculate the number of business days between two dates in SQL … Continue reading SQL Server – Calculating Business Days Between Two Dates (With Holiday Exclusion)