In SQL Server, you can use the DATEADD() function to get last 3 months (or n months) records. I have used this function in one of my previous posts where I have shown how easily you can get previous ...
You can easily escape a single quote in SQL Server by doubling it. Yes, it is that simple. Add two quotes (') instead of a single quote and SQL Server will store the single quote along the string in ...
In SQL Server, you can easily generate scripts for every object in a database. Its like having a softcopy of your database objects stored in a file. Once generated, you can save the script in a text ...
Let us assume, I have two dates with time like 2021-01-01 13:15PM and 2021-01-05 17:29PM and I want to display the number of days along with Hours and Minutes in this format… Total Days | hh:mm:ss ...
In SQL Server, you can use the DATENAME() function to get the week day for a given date. I’ll show you how to use this function to get first and last day of a given month or date in SQL Server. ...
There are two simple methods in SQL Server to check weather a given Column Exists in a Table or not. This is important when you are trying to add a new column in a table dynamically, without knowing ...
In SQL Server, you can use PIVOT to convert multiple rows into columns to show a summarized result. I’ll show how using this method you can easily save the rows to columns converted data into a table ...
You can use Excel as a database, as long as your requirements are limited. Create multiple sheets in your workbook, store various type data in the sheets and work with the data as and when required ...
The aggregate MIN() function in SQL Server is used to find the minimum or the smallest value of a column. It is a very commonly used built-in function in SQL Server. Now recently I came across ...
Yes, an SQL query can contain a WHERE and HAVING clause. You will use these together when you want to extract (or filter) rows for a group of data using a WHERE clause and apply a condition on the ...