ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-20
Functions
Dateparts in Date Functions
Transact-SQL date functions contain arguments called dateparts. Table 4-8
summarizes the dateparts supported by the NonStop ODBC Server.
If you use an unsupported datepart, an error message is generated and the statement
does not execute.
Results of Month Operations in Date Functions
Date functions used through the NonStop ODBC Server are executed by NonStop
SQL/MP. The results of date operations, therefore, follow NonStop SQL/MP rules when
Transact-SQL and NonStop SQL/MP have different rules for processing dates.
For example, the following statement is valid in Transact-SQL, but generates an error
message when executed through the NonStop ODBC Server:
select dateadd (month, 1, '1/31/1980')
Msg 18001, Level 16, State 1:
NonStop SQL message (8425) : Either an invalid date was input or the result
of the date-time expression produced an invalid date.
When executed in Transact-SQL, this statement produces the date 2/29/1980.
For information on NonStop SQL/MP datetime data, see “Language Elements” in the
NonStop SQL/MP Reference Manual.
Table 4-8. NonStop ODBC Server Support of Transact-SQL Dateparts
Datepart Abbreviation NonStop ODBC Server Support
day dd x
dayofyear dy –
hour hh x
millisecond ms x
minute mi x
month mm x
quarter qq –
second ss x
week wk –
weekday wd –
year yy x
x Indicates a supported datepart
– Indicates an unsupported datepart