The following T-SQL shows how to update a value using the results of a SELECT query. This applies to Microsoft SQL server (T-SQL) -- and will not work in MySQL.…
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…
CAUTION: The steps below will completely wipe the data from the USB drive you select. Make sure you choose the correct drive and backup any files on the drive you…
In an SQL statement, the IN operator allows you to multiple values in a WHERE clause, for example: SELECT * FROM 'table' WHERE 'field_id' = 1 AND 'field' IN (…
In WordPress, the WPDB class is available for interacting with the database, for example reading or writing data. The PREPARE method is almost always used along with the WPDB. PREPARE…
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,…
The following SQL statement shows how to combine a column into a single text string - separated by a comma. For example: Name Fred Jim Jane Betty Would be combined…
The following SQL statement shows how to take a decimal value, e.g. 1234567.89 and convert it to a space delimited currency - that is, instead of using commas to separate…