Calc cost per day of trip Formatting Decimal Values formatted 2 decimals To format numbers, use the Format function Sort by Cost per day Format(field, decimals) The Format function requires two parameters: Note sorting error. the field to format Correct in Order By the number of decimal places to display All numbers include commas when appropriate Example: Select Format(Avg(Salary),2) As AvgSalary From tblEmployee; List trip date, duration and Formatting Dates return date of each trip. Use the function to format dates Date_Format Format MMMM d, yyyy Date_Format(datefield, 'formatstring') (see documentation) is the field name or date literal to be Datefield formatted Sort by return date desc will probably include some of the Formatstring following: %d (day) %m (month) %Y (4-digit year) See the documentation for additional formatting codes
Formatting Decimal Values To format numbers, use the Format function Format(field, decimals) The Format function requires two parameters: the field to format the number of decimal places to display All numbers include commas when appropriate Example: Select Format(Avg(Salary),2) As AvgSalary From tblEmployee; Calc cost per day of trip formatted 2 decimals Sort by Cost per day Note sorting error. Correct in Order By Formatting Dates Use the Date_Format function to format dates Date_Format(datefield, 'formatstring') Datefield is the field name or date literal to be formatted Formatstring will probably include some of the following: %d (day) %m (month) %Y (4-digit year) See the documentation for additional formatting codes List trip date, duration and return date of each trip. Format MMMM d, yyyy (see documentation) Sort by return date desc