{"id":127,"date":"2009-07-20T14:02:00","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/www.yazilimmutfagi.com\/?p=127"},"modified":"2009-07-20T14:02:00","modified_gmt":"1970-01-01T00:00:00","slug":"t-sqlde-tarihler-uzerinde-islem-yapmak-icin-kullanilan-fonksiyonlar","status":"publish","type":"post","link":"https:\/\/www.yazilimmutfagi.com\/index.php\/2009\/07\/20\/t-sqlde-tarihler-uzerinde-islem-yapmak-icin-kullanilan-fonksiyonlar\/","title":{"rendered":"T-SQL&#8217;de Tarihler \u00dczerinde Islem Yapmak i\u00e7in Kullanilan Fonksiyonlar"},"content":{"rendered":"<p style=\"margin: 0cm 0cm 10pt;\" class=\"MsoNormal\"><span style=\"font-size: 10pt; line-height: 115%; font-family: &quot;Segoe UI&quot;,&quot;sans-serif&quot;;\">T-SQL de Tarih islemleri i&ccedil;in kullandigimi bir&ccedil;ok fonksiyon vardir. Bunlardan en &ccedil;ok kullanilanlar bir liste halinde verdim. Tarih &uuml;zerinde islemler yapabilmek i&ccedil;in bu kullanisli fonksiyonlari bilmemiz gerekiyor. <span style=\"\">&nbsp;<\/span>Bu fonksiyonlardan bazilari tarihden tarih &ccedil;ikarmak, tarih i&ccedil;inden g&uuml;n ay yil bulmak, Belirli bir tarihe g&uuml;n, ay yil ekleyerek olusan tarihi bulmak gibi siralanabilir.<\/span><\/p>\n<p style=\"margin: 0cm 0cm 10pt;\" class=\"MsoNormal\"><span style=\"font-size: 10pt; line-height: 115%; font-family: &quot;Segoe UI&quot;,&quot;sans-serif&quot;;\">Bu konuda &ccedil;ok fazla bir sey anlatmaya gerek duymuyorum. Asagidaki liste incelenecek olursa konunun anlasilacagini d&uuml;s&uuml;n&uuml;yorum. <\/span><\/p>\n<p style=\"margin: 0cm 0cm 10pt;\" class=\"MsoNormal\"><a href='www.yazilimmutfagi.com'>.<\/a><\/p>\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"1\" style=\"background: rgb(242, 242, 242) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; border-collapse: collapse;\" class=\"MsoTableGrid\">\n    <tbody>\n        <tr style=\"\">\n            <td valign=\"top\" width=\"614\" style=\"border: 1pt solid black; padding: 0cm 5.4pt; width: 460.6pt; background-color: transparent;\">\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">CURRENT_TIMESTAMP<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-07-20 10:39:15.097 <\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">day<\/span><span style=\"color: gray;\">,<\/span>2<span style=\"color: gray;\">,<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><\/span><span style=\"\">&nbsp;<\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-07-22 00:00:00.000<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">month<\/span><span style=\"color: gray;\">,<\/span>2<span style=\"color: gray;\">,<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-09-20 00:00:00.000<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEDIFF<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">day<\/span><span style=\"color: gray;\">,<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">,<\/span><span style=\"color: red;\">&#8216;2015-02-09&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2030 (G&uuml;n olarak aldik) <\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATENAME<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">month<\/span><span style=\"color: gray;\">,<\/span> <span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>July<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATENAME<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: blue;\">weekday<\/span><span style=\"color: gray;\">,<\/span> <span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>Monday<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEPART<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">month<\/span><span style=\"color: gray;\">,<\/span> <span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>7<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;Suanki Zaman ve Tarihi verir<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">()<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-07-20 11:52:32.893<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Londra &#8211; Greenwich Saati<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">GETUTCDATE<\/span><span style=\"color: gray;\">()<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-07-20 08:52:44.693<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;Girilen string degerin tarih olup olmadigini belirler. 1 ise tarih 0 ise degil.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">ISDATE<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>1<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">ISDATE<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: red;\">&#8216;2014-18-09&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>0<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><a href='www.yazilimmutfagi.com'>.<\/a><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;girilen Tarihin g&uuml;n bilgisini verir.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DAY<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>20<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;girilen Tarihin ay bilgisini verir.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">MONTH<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>7<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;Girilen Tarihin yil bilgisini verir.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">YEAR<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: red;\">&#8216;2009-07-20&#8217;<\/span><span style=\"color: gray;\">)<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;Sistem Zamanini verir.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">SYSDATETIME<\/span><span style=\"color: gray;\">()<\/span><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-07-20 11:53:15.7138432<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8211;Sistem Zamanini Greenwiche g&ouml;re verir.<span style=\"\"> <\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">SYSUTCDATETIME<\/span><span style=\"color: gray;\">()<\/span><span style=\"\">&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: green;\">&#8212; Sonu&ccedil; :<span style=\"\">&nbsp; <\/span>2009-07-20 08:53:25.9958432<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&nbsp;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; DATEADD: Suank, Tarihe 7 G&uuml;n ekleyelim.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Bunun i&ccedil;in 1 hafta eklemek veya 7 g&uuml;n eklemek yeterlidir.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span>DD<span style=\"color: gray;\">,<\/span> 7<span style=\"color: gray;\">,<\/span> <span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span>WW<span style=\"color: gray;\">,<\/span> 1<span style=\"color: gray;\">,<\/span> <span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Suanki Tarihe g&ouml;re Ayin hangi g&uuml;n&uuml;ndeyiz.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DAY<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Suanki Ayin Ilk g&uuml;n&uuml;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span>DD<span style=\"color: gray;\">,-(<\/span><span style=\"color: fuchsia;\">DAY<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())-<\/span>1<span style=\"color: gray;\">),<\/span><span style=\"color: fuchsia;\">CONVERT<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: blue;\">VARCHAR<\/span><span style=\"color: gray;\">,<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">(),<\/span>112<span style=\"color: gray;\">))<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Suanki Ayin son g&uuml;n&uuml;<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span>DD<span style=\"color: gray;\">,-(<\/span><span style=\"color: fuchsia;\">DAY<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span>MM<span style=\"color: gray;\">,<\/span>1<span style=\"color: gray;\">,<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">()))),<\/span><span style=\"color: fuchsia;\">DATEADD<\/span><span style=\"color: gray;\">(<\/span>MM<span style=\"color: gray;\">,<\/span>1<span style=\"color: gray;\">,<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span style=\"color: fuchsia;\">CONVERT<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: blue;\">VARCHAR<\/span><span style=\"color: gray;\">,<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">(),<\/span>112<span style=\"color: gray;\">)))<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; DATEDIFF: Ocak 1 2007 den bugune kadar ka&ccedil; g&uuml;n ge&ccedil;ti<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATEDIFF<\/span><span style=\"color: gray;\">(<\/span>DD<span style=\"color: gray;\">,<\/span><span style=\"color: red;\">&#8216;20070101&#8217;<\/span><span style=\"color: gray;\">,<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; DATENAME: Suanki Ay<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">DATENAME<\/span><span style=\"color: gray;\">(<\/span>MM<span style=\"color: gray;\">,<\/span> <span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Hangi Aydayiz.<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">MONTH<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">GETDATE<\/span><span style=\"color: gray;\">())<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"><span style=\"\">&nbsp;<\/span><\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: green; font-family: &quot;Courier New&quot;;\">&#8212; Hangi Yildayiz<\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt; color: blue; font-family: &quot;Courier New&quot;;\">SELECT<\/span><span style=\"font-size: 9pt; font-family: &quot;Courier New&quot;;\"> <span style=\"color: fuchsia;\">YEAR<\/span><span style=\"color: gray;\">(<\/span><span style=\"color: fuchsia;\">CURRENT_TIMESTAMP<\/span><span style=\"color: gray;\">)<\/span> <\/span><\/p>\n            <p style=\"margin: 0cm 0cm 0pt; line-height: normal;\" class=\"MsoNormal\"><span style=\"font-size: 9pt;\"><span style=\"font-family: Calibri;\">&nbsp;<\/span><\/span><\/p>\n            <\/td>\n        <\/tr>\n    <\/tbody>\n<\/table>\n<p style=\"margin: 0cm 0cm 10pt;\" class=\"MsoNormal\"><span style=\"font-size: small; font-family: Calibri;\">&nbsp;<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>T-SQL de Tarih islemleri i&#231;in kullandigimi bir&#231;ok fonksiyon vardir. Bunlardan en &#231;ok kullanilanlar bir liste halinde verdim. Tarih &#252;zerinde islemler yapabilmek i&#231;in bu kullanisli fonksiyonlari bilmemiz gerekiyor.  Bu fonksiyonlardan bazilari tarihden tarih &#231;ikarmak ,t-sql,tsql, tarih i&#231;inden g&#252;n ay yil bulmak, <\/p>\n","protected":false},"author":517,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[422],"tags":[4317,4457,5297,5069,5662,6486,6238,5760,6037,5199,6099,6269,6457,6466,6481,6361,6398,6442,6340],"_links":{"self":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts\/127"}],"collection":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/users\/517"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":0,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yazilimmutfagi.com\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}