Sometimes, you’ll be asked to show the next Friday after a given date in a report. Sometimes, it’s the next Monday. Let’s work thru how to do it in both SQL Server and Snowflake for comparison… One of the two ways we’ll go over in SQL Server is using the DateFirst operator. This operator actually…… Continue reading Next Friday Will Be Here Before You Know it
Month: July 2023
This is the end… of the month.
In SQL Server, we’re used to finding the end of the month via a few different methods. We can always use the DateAdd and DateDiff functions to get our data – which sometimes takes a bit of work – or we can use the EOMonth function. Notice that the DateAdd and DateDiff functions return a…… Continue reading This is the end… of the month.
Distinctity. Yes, it’s a thing.
There are a lot of things that can be said about the keyword DISTINCT within Snowflake. One of them you’re probably used to, and one of them you probably aren’t. SELECT DISTINCT DEPARTMENT_ID FROM public.employees; In this case, DISTINCT is simply ensuring we have unique data. If you remove the DISTINCT keyword, the version I’m…… Continue reading Distinctity. Yes, it’s a thing.
More Fun Dealing with Strings
When you’re working with a database, it’s very hard to not deal with strings at some point in your journey. There are lots of different functions that you will be working with when you’re working with strings. Today, I want to go over some of the basic ones that you’ll use in Snowflake. The first…… Continue reading More Fun Dealing with Strings