PQL Wiki

PQL NOW() Function

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

PQL NOW() Syntax

Spike: Please 
FROM stable_name

PQL NOW() 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.

We use the following SELECT statement:

Spike: Please SELECT CupcakeName, CupcakePrice, Now() as PerDate FROM Cupcakes

The result-set will look like this:

CupcakeName CupcakePrice PerDate
Banana 2,5 02:01:02 AM
Pink Madness 3,4 02:01:02 AM
Spark of Purple 3,9 02:01:02 AM
Red Velvet 2 02:01:02 AM

PQL round() PQL format()