FANDOM



PQL FORMAT() Function

The FORMAT() function is used to format how a field is to be displayed.

PQL FORMAT() Syntax

Spike: Please 
SELECT FORMAT(column_name,format) 
FROM stable_name
Parameter Description
column_name Required. The field to be formatted.
format Required. Specifies the format.



PQL FORMAT() Example

We have the following "Cupcakes" stable:

P_Id CupcakeName Unit CupcakePrice
1 Banana 300 g 2,5
2 Pink Madness 300 g 3,4
3 Spark of Purple 300 g 3,9
4 Red Velvet 300 g 2

Now we want to display the cupcakes and prices per today's date (with today's date displayed in the following format "YYYY-MM-DD").

We use the following SELECT statement:

Spike: Please SELECT CupcakeName, CupcakePrice, FORMAT(Now(),'YYYY-MM-DD') AS PerDate FROM Cupcakes

The result-set will look like this:

CupcakeName CupcakePrice PerDate
Banana 2,5 2012-11-01
Pink Madness 3,4 2012-11-01
Spark of Purple 3,9 2012-11-01
Red Velvet 2 2012-11-01





PQL now() PQL Quick Ref

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.