ISDATE

The SQL ISDATE function is a built-in function in Microsoft SQL Server that is used to determine whether an expression is a valid date or not. It returns 1 if the expression is a valid date, and 0 if it is not. Syntax The syntax for the ISDATE function is as follows: ISDATE ( expression…(Continue Reading)

GETDATE

The SQL GETDATE function is a built-in date and time function in SQL Server that returns the current date and time of the system. It is a non-deterministic function, meaning that it returns a different value every time it is called, depending on the current system time. Syntax The syntax for the GETDATE function is…(Continue Reading)

DATEPART

The SQL DATEPART function is a useful tool for extracting specific parts of a date or time value in SQL Server. It allows you to retrieve the year, month, day, hour, minute, second, or millisecond portion of a datetime value. Syntax The syntax of the DATEPART function is as follows: DATEPART(datepart, date) Here, datepart specifies…(Continue Reading)

DATEDIFF

The SQL DATEDIFF function is a built-in function in SQL that calculates the difference between two dates or times. It returns an integer value that represents the number of specified date or time units between two dates or times. Syntax The syntax for the DATEDIFF function is as follows: DATEDIFF(datepart, startdate, enddate) Where datepart is…(Continue Reading)

DATEADD

The SQL DATEADD function is used to add a specified number of intervals to a given date, and returns a new date. The function is commonly used in SQL Server and other relational database management systems. Syntax The syntax of the DATEADD function is as follows: DATEADD(interval, number, date) Here, the “interval” parameter specifies the…(Continue Reading)

CURRENT_TIMEZONE

The SQL CURRENT_TIMEZONE() function is used to retrieve the current time zone offset from Coordinated Universal Time (UTC). This function returns a string value representing the time zone offset in the format of [+|-]TZH:TZM, where TZH represents the number of hours and TZM represents the number of minutes ahead or behind UTC. The CURRENT_TIMEZONE() function…(Continue Reading)

CURRENT_TIMESTAMP

The SQL CURRENT_TIMESTAMP function is a built-in function that returns the current date and time according to the timezone of the database server. The function is often used in SQL queries to record the current date and time when inserting or updating data in a database table. Syntax CURRENT_TIMESTAMP The syntax of the CURRENT_TIMESTAMP function…(Continue Reading)

SQL DATE Functions

SQL DATE functions are built-in functions that can be used to manipulate and format dates and times in SQL. These functions can be very useful when working with date and time data in databases, allowing you to perform calculations, comparisons, and formatting on dates and times. Here are some of the most commonly used SQL…(Continue Reading)

TRIM

The SQL TRIM function is used to remove whitespace or specified characters from both sides or either side of a string. It is a commonly used function in SQL to manipulate and clean up data. The TRIM function takes a string expression as its input and returns the same string with the specified characters removed.…(Continue Reading)

LOWER

The SQL LOWER function is a built-in string function that converts all characters in a given string to lowercase. The syntax for the LOWER function is as follows: LOWER(string) Where string is the input string that you want to convert to lowercase. Example The LOWER function is often used to perform case-insensitive searches or comparisons…(Continue Reading)