Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:sql:functions:extract [2009/12/04 23:17]
tdo
dev:sql:functions:extract [2012/10/26 14:28] (current)
Line 11: Line 11:
 Required. The date part that is to be extracted. See below for a complete list of date parts that can be used in this parameter. Click to see a list of valid datefield options. Required. The date part that is to be extracted. See below for a complete list of date parts that can be used in this parameter. Click to see a list of valid datefield options.
  
-<​code>​ 
 Valid datefield Options: Valid datefield Options:
 +^ Date_field ^ Description ^
 | YEAR | | | YEAR | |
 | MONTH | | | MONTH | |
Line 44: Line 44:
 | A | Lowercase am/pm indicator | | A | Lowercase am/pm indicator |
 | AA | Uppercase AM/PM indicator | | AA | Uppercase AM/PM indicator |
-</​code>​ 
 == FROM == == FROM ==
 Required. Required.
Line 51: Line 50:
 Required. A date formatted as any valid SQL92 date_class data type. Required. A date formatted as any valid SQL92 date_class data type.
  
-If the original date is an OMNIDEX DATE or OMNIDEX DATETIME column, the return data type is C STRING length 32. Otherwise, the return data type is as follows:+If the original date is an OMNIDEX DATE or OMNIDEX DATETIME column, the return data type is C STRING length 32. 
  
 ===== Example ===== ===== Example =====
 ==== Example 1 ==== ==== Example 1 ====
 +<code SQL>
 +select status,
 +extract(mmm FROM orders.order_date)
 +from orders ​
 +where product_no='​PRN4356'​
 +
 +ORDR   ​JANUARY
 +ORDR   ​DECEMBER
 +CNCL   MARCH
 +</​code>​
 +
 {{page>:​bottom_add&​nofooter&​noeditbtn}} {{page>:​bottom_add&​nofooter&​noeditbtn}}
 
Back to top
dev/sql/functions/extract.1259968633.txt.gz ยท Last modified: 2012/10/26 14:27 (external edit)