MySQL day of week ending on Friday
Week Ending Date has been requested a lot more frequently now. It's an odd one but the example below shows how to do this for when the week ends on Friday. Assuming it starts on the previous Saturday.
Knowledge base / Since 1999
Practical Databases tutorials, troubleshooting notes and implementation guides from real projects.
Advanced search75 entries / Databases
Clear filters
Week Ending Date has been requested a lot more frequently now. It's an odd one but the example below shows how to do this for when the week ends on Friday. Assuming it starts on the previous Saturday.
The problem is that if the student does not have a username but has an ID number, then the first query returns NO ROWS and then the second query errors and the whole stored procedure fails. The same problem happens when using these as a subquery which has an empty result set. Furthermore I am using this stored procedur...
I asked someone for a simple, easy and basic Oracle stored procedure as my MySQL and T-SQL stored procedures work slightly differently and are easier to pull off. After much umming and aah-ing, I have written this article as a note for me to demo a working stored procedure and how to use cursors. I'm told I need to use...
I need to refer to how to create a function in Oracle PL/SQL and sites on the net just attempt to overcomplicate everything and have forgotten how it is to be new to Oracle. I need a function in it's simplest form and if I want to torture my successors, I'll complicate the function myself. How? Functions are supposed t...
I have a mySQL database table of room assets that has a field containing the ID numbers of images relevant to this room. The Problem? When I select specifying the statement "WHERE IN (c.RoomImages)", this is interpreted as a string and when converted to a number only retrieves the first value before the first comma. Co...
Need to be able to omit HTML tags in certain fields of a mySQL database.
MySQL is just the best Unfortunately I make a living using Microsoft and Oracle products. I shouldn't say unfortunately as I don't see myself doing any other job and it beats daytime television any day. I use this quite a lot so I thought I'd put an article here somewhere. Based on the following concept: RowID column_t...
Why? I recently made a joomla module that displays the lastest members to signup. It goes a little further and counts activated accounts for the past day, week, month and year (the below examples count all accounts irrespective of being activated or not). It needs to pick up trends as well and compare for example today...
I have googled, binged and asked but to no avail. Some self-proclaimed IT experts in forums said "why would you want to do that?". Unhelpful Bellends. It's a bit like asking me "Why can't I turn on my computer" and me replying "why would you want to do that?". Anyway, I was looking for something like the record separat...
Working principle
This site exists as a practical knowledge base built from real-world experience across systems, platforms, and technologies since 1999. Much of the content documents solutions, edge cases, and working patterns that were learned through investigation where documentation was incomplete or absent, and is shared to reduce the same friction for others.
Protected notes
Log in for protected notes and any private client projects assigned to your account.