Sql server® 2012 t-sql fundamentals



Download 10,93 Mb.
Pdf ko'rish
bet136/443
Sana26.01.2022
Hajmi10,93 Mb.
#411755
1   ...   132   133   134   135   136   137   138   139   ...   443
Bog'liq
BookSQL

The 

ISDATE

 Function

The ISDATE function accepts a character string as input and returns 1 if it is convertible to a date and 

time data type and 0 if it isn’t.

Syntax

ISDATE(string)

For example, the following code returns 1.

SELECT ISDATE('20090212');

And the following code returns 0.

SELECT ISDATE('20090230');

www.it-ebooks.info



 

CHAPTER 2

 

Single-Table Queries



 

 87

The 

FROMPARTS

 Functions

The FROMPARTS functions were introduced in SQL Server 2012. They accept integer inputs represent-

ing parts of a date and time value and construct a value of the requested type from those parts. 

Syntax

DATEFROMPARTS (yearmonthday)

DATETIME2FROMPARTS (yearmonthdayhourminutesecondsfractionsprecision)

DATETIMEFROMPARTS (yearmonthdayhourminutesecondsmilliseconds)

DATETIMEOFFSETFROMPARTS (yearmonthdayhourminutesecondsfractionshour_offsetmin-

ute_offsetprecision)

SMALLDATETIMEFROMPARTS (yearmonthdayhourminute)

TIMEFROMPARTS (hourminutesecondsfractionsprecision)

These functions make it easier for applications to construct date and time values from the differ-

ent components, and they also simply migrate from other environments that already support similar 

functions. The following code demonstrates the use of these functions.

SELECT 

  DATEFROMPARTS(2012, 02, 12), 

  DATETIME2FROMPARTS(2012, 02, 12, 13, 30, 5, 1, 7), 

  DATETIMEFROMPARTS(2012, 02, 12, 13, 30, 5, 997), 

  DATETIMEOFFSETFROMPARTS(2012, 02, 12, 13, 30, 5, 1, -8, 0, 7), 

  SMALLDATETIMEFROMPARTS(2012, 02, 12, 13, 30), 

  TIMEFROMPARTS(13, 30, 5, 1, 7);


Download 10,93 Mb.

Do'stlaringiz bilan baham:
1   ...   132   133   134   135   136   137   138   139   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish