The following T-SQL statement shows how output a number as an ordinal number (st, nd, rd, th). For example, 3 would output 3rd. How do I use this? Replace '3'…
The following T-SQL statement shows how output the day from a date as an ordinal number (st, nd, rd, th). For example, 16 March 2019 would output 16th. How do…
When you have a date or datetime column in an SQL database, it will output a value that looks like 2017-01-01 00:00:00.000 This is the standard format used for datetime columns…
The following SQL shows how to get the current financial year using SQL. This assumes that the financial year for your country is 1 July - 30 June. This SQL…
The following SQL shows how to select a row from a table using the current financial year as the WHERE condition. This is useful if you have a table of…
Here's a little trick you can use to return TRUE/FALSE if a query has returned results. For example if a Person is in Category_ID 325 or 326 we want TRUE,…