Sybase 12.4.2 Server User Manual


 
CHAPTER 5 Moving Data In and Out of Databases
211
On input, the case the format code is ignored.
On output, the case of the format code has the following effect:
Mixed case (for example, “Dd”) means do not pad with zeroes.
Same case (for example, “DD” or “dd” means do pad with zeroes.
For example, a time as 17:23:03.774 using the default time format, but as
17:23:3.774 using 'HH:NN:Ss.SSS'.
The next table shows examples of how date input data looks and how to specify
the format with the
DATE conversion option. Following the table are general
rules for specifying dates.
Table 5-8: Sample DATE format options
•The DATE specification must be in parentheses and enclosed in single or
double quotes.
Adaptive Server IQ stores only the numbers of the year, month, and day;
it does not store any other characters that might appear in the input data.
However, if the input data contains other characters, for example, slashes
(/), dashes (-), or blanks to separate the month, day, and year, the
DATE
format must show where those characters appear so they can be ignored.
mm or MM Represents number of month. Always use leading zeros for
number of the month where appropriate, for example ’05’ for
May. If you omit the month from a DATE value, the day is
treated as a Julian date. If you enter only the month, for
example, ’03’, Adaptive Server IQ applies the default year and
day and converts it to ’1900-03-01’.
dd or DD
jjj or JJJ
Represents number of day. Default day is 01. Always use
leading zeros for number of day where appropriate, for example
’01’ for first day. J or j indicates a Julian day (1 to 365) of the
year.
Option Meaning
Input Data Format Specification
12/31/98
DATE (’MM/DD/YY’)
12-31-98
DATE (’MM-DD-YY’)
19981231
DATE (’YYYYMMDD’)
12/98
DATE (’MM/YY’)
1998/123
DATE (’YYYY/JJJ’)