Tutoriel SQL

ACCUEIL SQL Introduction SQL Syntaxe SQL Sélection SQL SQL Select Distinct SQL Où SQL et, ou, pas Tri SQL par Insertion SQL dans Valeurs nulles SQL Mise à jour SQL Supprimer SQL SQL Sélectionner Haut Min et Max SQL Nombre SQL, Moy, Somme J'aime SQL Caractères génériques SQL Entrée SQL SQL Entre Alias ​​SQL Jointures SQL Jointure interne SQL Jointure gauche SQL Jointure droite SQL Jointure complète SQL Auto-jointure SQL Union SQL Regrouper SQL par SQL ayant SQL existe SQL Tout, Tout SQL Sélectionner dans Insertion SQL dans la sélection Cas SQL Fonctions nulles SQL Procédures stockées SQL Commentaires SQL Opérateurs SQL

Base de données SQL

SQL Créer une base de données BD de suppression SQL Base de données de sauvegarde SQL Créer une table SQL Table de dépôt SQL Table de modification SQL Contraintes SQL SQL non nul SQL unique Clé primaire SQL Clé étrangère SQL Vérification SQL SQL par défaut Index SQL Incrément automatique SQL Dates SQL Vues SQL Injection SQL Hébergement SQL Types de données SQL

Références SQL

Mots clés SQL Fonctions MySQL Fonctions SQL Server Fonctions MS Access Référence rapide SQL

Exemples SQL

Exemples SQL Questionnaire SQL Exercices SQL Certificat SQL

Fonction MS Access Format()

❮ Fonctions MS Access

Exemple

Formater une expression numérique en pourcentage :

SELECT Format(0.5, "Percent") AS FormattedNum;

Définition et utilisation

La fonction Format() formate une valeur numérique avec le format spécifié.

Syntaxe

Format(value, format)

Valeurs des paramètres

Parameter Description
value Required. The numeric value to format
format Optional. The format to to use.
Format Description
General Number Indicates a number, without thousand separators
Currency Indicates currency, with thousand separators and two decimal places
Fixed Shows minimum one digit to the left of the decimal place and two digits to the right of the decimal place
Standard Shows the thousand separators + minimum one digit to the left of the decimal place, and two digits to the right of the decimal place
Percent Shows a percent value (with percent sign) and two digits to the right of the decimal place
Scientific Indicates scientific notation
Yes/No Shows No if value = 0 and Yes if value <> 0
True/False Shows False if value = 0 and True if value <> 0
On/Off Shows Off if value = 0 and On if value <> 0

Détails techniques

Travaille dans: Depuis Access 2000

Plus d'exemples

Exemple

Formatez la colonne "Prix" en devise :

SELECT Format(Price, "Currency") AS FormattedPrice
FROM Products;

❮ Fonctions MS Access