傳回 Variant (Integer),指定表示分鐘內秒數之 0 到 59 之間 (包含) 的整數。
語法
第二個 (時間)
required time引數是任何 Variant、數值運算式、字串運算式,或這些可代表時間的任何組合。 如果 time 包含 Null,則會傳回 Null 。
查詢範例
| 運算式 | 結果 |
|---|---|
| SELECT Second ([DateTime]) AS SecondValue FROM ProductSales; | 傳回欄位 “DateTime” 的 “Second” 值,但不含任何其他資訊,並顯示在 SecondValue 資料行中。 |
VBA 範例
注意
下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。
此範例使用 Second 函數從指定的時間取得分鐘的秒。 在開發環境中,時間常值會使用程式碼的地區設定,以短時間格式顯示。
Dim MyTime, MySecond
MyTime = #4:35:17 PM# ' Assign a time.
MySecond = Second(MyTime) ' MySecond contains 17.