cancel
Showing results for 
Search instead for 
Did you mean: 

temporal data types

User
Not applicable
Hi, can someone illustrate with small examples difference between dat atypes 12 15 16 and 19
1 REPLY 1

Himanshu
New Contributor II
Lets see

charsizenumliteralnullnamesqljava.net
b110bbooleanBooleanboolean
g1620NgguidUUIDGUID
x140x00byteBytebyte
h250h0NhshortsmallintShortint16
i4600NintintIntegerint32
j870j0NjlongbigintLongint64
e480e0NerealrealFloatsingle
f890.0 or 0f0nfloatfloatDoubledouble
c110" "" "charCharacterchar
s.11``symbolvarcharStringstring
p812dateDtimespan0NptimestampTimestampDateTime (r/w)
m4132000.01m0Nmmonth
d4142000.01.010NddatedateDate
z815dateTtime0NzdatetimetimestampTimestampDateTime*(read only)
n81600:00:00.0000000000NntimespanTimespanTimeSpan
u41700:000Numinute
v41800:00:000Nvsecond
t41900:00:00.0000NttimetimeTimeTimeSpan

Type 12 - dateDtimeSpan. This is a combo of DATE and TIMESPAN. What's the timespan? That's the type 16. Here is an example:
q).z.p
2015.07.13D13:48:20.890703000
The part to the left of 'D' is date and the right part is timespan.

Type 15 - combination of date and timestamp. Here is an example:
q).z.z
2015.07.13T13:49:24.958

Note that the Date and Timestamp are separated by 'T'.

Type 16 - This is just timespan that you saw appended to date in type 12.

Type 19 - This is just time...not as precise as timespan.