CommencerCommencer gratuitement

Formatting timestamps and dates

Timestamps can be confusing when viewed as text (e.g., '2020-06-02 23:57:12.120174 UTC'), especially in a report format. Ensuring that your reports are easy to understand can be a factor in determining how your results are used.

Cet exercice fait partie du cours

Introduction to BigQuery

Afficher le cours

Instructions

  • Add the date formatting for the column order_purchase_timestamp in the 'MM/DD/YY' format using the %D option.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

-- Fill in the query to find the three days with the most orders

SELECT
	-- First, add the date formatting for dates
	FORMAT_TIMESTAMP(___, ___) AS order_date,
    order_id
FROM 
	ecommerce.ecomm_order_details
LIMIT 3;
Modifier et exécuter le code