Database.Guide

Skip to content

Beginners

  • What is a Database?
  • Database Tutorial

SQL

  • SQL Tutorial
  • SQL Reference
  • SQL Joins Tutorial
  • SQL Transactions Tutorial
  • Basic SQL Queries

Categories

  • Azure SQL Edge (17)
  • Database Concepts (99)
  • Database Tools (72)
  • DBMS (9)
  • DuckDB (161)
  • MariaDB (424)
  • Microsoft Access (17)
  • MongoDB (265)
  • MySQL (602)
  • NoSQL (8)
  • Oracle (301)
  • PostgreSQL (480)
  • Redis (210)
  • SQL (697)
  • SQL Server (1,170)
  • SQLite (299)

Tag: dates

Get the Day of the Year from a Date in SQL Server (T-SQL)

Posted on June 21, 2021 by Ian

TSQL provides the DATEPART() function, which enables us to return the day of the year for a given date in SQL Server.

By “day of the year”, I mean the day number of the given year.

Continue reading →
SQL Server dates, how to, mssql, t-sql

4 Functions that Extract Microseconds from a Time Value in MariaDB

Posted on June 20, 2021 by Ian

Below are 4 functions that enable you to return the microseconds part from a time value in MariaDB.

Continue reading →
MariaDB dates, how to, time format

3 Ways to Get the Day Name from a Date in MariaDB

Posted on June 19, 2021 by Ian

Below are three approaches you can use to get the day name from a date in MariaDB.

Two of these approaches return the full day name, and one returns the short day name.

Continue reading →
MariaDB date format, dates, how to

Fix: “Unknown table ‘locales’ in information_schema” in MariaDB

Posted on June 19, 2021 by Ian

If you get the Unknown table 'locales' in information_schema error in MariaDB, it’s probably because you haven’t installed the LOCALES plugin yet.

You need to install the LOCALES plugin before you try to query this table.

Continue reading →
MariaDB dates, errors, how to

11 Functions to Get the Day, Month, and Year from a Date in MariaDB

Posted on June 18, 2021 by Ian

MariaDB includes many functions for working with dates. Some of these extract certain parts from such dates and return them as a string or integer.

Below are 11 functions that you can use to return various date parts in MariaDB.

Continue reading →
MariaDB date format, dates, how to

8 Ways to Add Microseconds to a Datetime Value in MariaDB

Posted on June 12, 2021 by Ian

If you need to add one or more microseconds to a datetime value in MariaDB, here are 8 options to consider.

Continue reading →
MariaDB dates, how to

3 Ways to Convert a Date to a String in MongoDB

Posted on June 5, 2021 by Ian

MongoDB has a Date BSON type that allows you to store dates as dates.

You can also store dates as strings, if that’s what you need.

Taking it a step further, you can also convert a Date to a string.

This article presents three ways to convert a Date to a string in MongoDB.

Continue reading →
MongoDB convert, date format, dates, how to, string

Convert a Month Name to the Month Number in SQL Server (T-SQL)

Posted on June 3, 2021 by Ian

In SQL Server, you can use the MONTH() function to convert a month name to its corresponding number.

Continue reading →
SQL Server date format, dates, how to, mssql, t-sql

3 Ways to Extract the Year from a Date in SQL Server (T-SQL)

Posted on May 30, 2021 by Ian

There are several ways to return the year from a date in SQL Server. Here are three (or is it four?).

Continue reading →
SQL Server dates, how to, mssql, t-sql

8 Ways to Add Seconds to a Datetime Value in MariaDB

Posted on May 26, 2021 by Ian

If you need to add one or more seconds to a datetime value in MariaDB, here are 8 options to consider.

Continue reading →
MariaDB dates, how to
  • «
  • 1
  • …
  • 19
  • 20
  • 21
  • 22
  • 23
  • …
  • 46
  • »

About Database.Guide | Privacy Policy