SQL.GetFieldAsTime
------------------

Returns field's value as time value; converts if needed.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [2.6](newinversion26.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.GetFieldAsTime"; Command; Field ) 

**MBS**( **"SQL.GetFieldAsTime";** /\* Returns field's value as time value; converts if needed. \*/  
**$Command**; /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/   
**$Field**) /\* The name or one based index of the field. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |
| Field | The name or one based index of the field. | $Field |

### Result

Returns time or error message.

### Description

Returns field's value as time value; converts if needed.  
  
see also:  
[https://www.sqlapi.com/ApiDoc/class\_s\_a\_field.html](https://www.sqlapi.com/ApiDoc/class_s_a_field.html)  
### See also

- [SQL.ConvertDateTimeFromSQL](SQLConvertDateTimeFromSQL.md)
- [SQL.GetFieldAsDate](SQLGetFieldAsDate.md)
- [SQL.GetFieldAsPDF](SQLGetFieldAsPDF.md)
- [SQL.GetFieldAsText](SQLGetFieldAsText.md)
- [SQL.GetFieldIsNull](SQLGetFieldIsNull.md)
- [SQL.GetFieldName](SQLGetFieldName.md)
- [SQL.GetFieldOption](SQLGetFieldOption.md)
- [SQL.GetFieldsAsJSON](SQLGetFieldsAsJSON.md)
- [SQL.GetFieldValue](SQLGetFieldValue.md)
- [SQL.GetParamAsTime](SQLGetParamAsTime.md)

### Release notes

- **Version 8.3**
    - Improved [SQL.GetFieldAsTime](http://www.mbsplugins.eu/SQLGetFieldAsTime.shtml) to handle intervals and return them as time.
- **Version 8.2**
    - Changed [SQL.GetFieldAsTime](http://www.mbsplugins.eu/SQLGetFieldAsTime.shtml) to return a time and not timestamp.

### Blog Entries

- [MBS FileMaker Plugin, version 8.3pr5](https://www.mbsplugins.de/archive/2018-07-10/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.2pr1](https://www.mbsplugins.de/archive/2018-04-04/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 10th January 2020

  
[SQL.GetFieldAsText](SQLGetFieldAsText.md) - [SQL.GetFieldDataType](SQLGetFieldDataType.md)

[HTML Version](SQLGetFieldAsTime.shtml)