Description:
This function returns the seconds of a time value. The second is given as an integer in the range 0 (zero) to 59.
Syntax: SECOND (serial_number)
Remarks
Example
The SECOND function can be used in any database where you have stored values for the serial number which is the number of days counted from 1/1/1900 as explained above. If you want to return the "seconds" value that corresponds with the time element of the serial number, in this case it is possible to access this value with the help of this function. This function displays the value of "Seconds" as a number corresponding to the time element of the serial date which in turn is counted as explained above. The 1stof January, 1900 forms the base date for the "SECOND" and the other related functions too.
=SECOND (37459.59) |
-Serial Number is converted to the date, and the time element from the date determined and from that the value for "second" is captured and returned as the result.(The second returned for this serial date = 36) |
=SECOND ("range reference") |
-Serial number in the range is converted to Date as the serial number counted ahead from 1st January, 1900 till serial date and the second element from that date is returned by the function. |
Let us take the example of the HR database in PowerOLAP which has data which that gives the information for the serial date value and this is the parameter that can be used in order to calculate the "second" with the help of the "SECOND" function.In this case however, we have written a formula in the appropriate cube in PowerOLAP, but instead of pulling in values from the "Serial Date" member, and then writing those to this formula, in this example we are using the NOW function which automatically supplies the current date and time as a parameter to the "SECOND" function and that serial number value is used to write the value into another member of the dimension namely, "Second" and apart from this example you can even do this for a different dimension in a different cube.
The formula above writes values into the "Staff Date Lookup" cube to the "Staff Date Lookup" dimension into the member named "Second" by calculating the appropriate value from the "Serial Date" number supplied which is generated by the NOW functions and supplied as a parameter to the "SECOND" function This function takes the "Serial Date" as a parameter, and captures the "second" element from that serial number and returns the value that represents the second element from the parameter serial number.