SQL NOW() function


The NOW() function returns the date and time of the current system.

SQL NOW() syntax

SELECT NOW() FROM table_name;        

Demonstrate the database


In this tutorial, we'll use the well-known Northwind sample database.

Here's the data from the Products table:

ProductID ProductName SupplierID CategoryID Unit Price
1 Chais 1 1 10 boxes x 20 bags 18
2 Chang 1 1 24 - 12 oz bottles 19
3 Aniseed Syrup 1 2 12 - 550 ml bottles 10
4 Chef Anton's Cajun Seasoning 2 2 48 - 6 oz jars 21.35
5 Chef Anton's Gumbo Mix 2 2 36 boxes 25


SQL NOW() instance

The following SQL statement selects the product name and the price for the day from the Products table:

SELECT ProductName, Price, Now() AS PerDate
FROM Products;