﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Tarih Kontrolü Fonksiyonu &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/sql-tarih-kontrolu-fonksiyonu/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Mon, 13 Jun 2022 20:16:03 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>SQL Server&#8217;da Tarih Kontrolü Fonksiyonu</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-tarih-kontrolu-fonksiyonu</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Fri, 08 Apr 2022 18:46:46 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Tarih Kontrolü]]></category>
		<category><![CDATA[SQL Tarih Kontrolü Fonksiyonu]]></category>
		<category><![CDATA[Tarih Kontrolü Fonksiyonu]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=11667</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server&#8217;da tarih kontrolü fonksiyonu hakkında bilgi vereceğim. SQL Server&#8217;da bazı durumlarda elinizde tarihi kontrol ettirmek isteyebilirsiniz. Aşağıdaki fonksiyonu kullanarak siz...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server&#8217;da tarih kontrolü fonksiyonu hakkında bilgi vereceğim.</p>
<p>SQL Server&#8217;da bazı durumlarda elinizde tarihi kontrol ettirmek isteyebilirsiniz.</p>
<p>Aşağıdaki fonksiyonu kullanarak siz de bu işlemi rahatlıkla yapabilirsiniz.</p>
<pre class="line-numbers"><code class="language-sql">--Fonksiyonun oluşturulması

CREATE FUNCTION dbo.fn_TarihKontrolu
(@Tarih nvarchar(50))
RETURNS DATETIME
AS
    BEGIN
        declare @Sonuc DATETIME

        select @Sonuc = CASE WHEN ISDATE(@Tarih) = 1
                            THEN CASE WHEN CAST(@Tarih as DATETIME) BETWEEN '1.1.1901 12:00:00 AM' AND '1.6.2079 12:00:00 AM'
                                    THEN @Tarih
                                    ELSE null
                                    END
                            ELSE null
                            END
        return @Sonuc
    END
GO

--Fonksiyonun kullanımı

SELECT dbo.fn_TarihKontrolu('02.29.2012')
SELECT dbo.fn_TarihKontrolu('02.29.2013')
SELECT dbo.fn_TarihKontrolu('04.30.2012')
SELECT dbo.fn_TarihKontrolu('02.31.2012')</code></pre>
<p>Fonksiyonu oluşturup kodu çalıştırdığınızda aşağıdakine benzer bir sonuç göreceksiniz.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-11669 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2021/11/sql-serverda-tarih-kontrolu-fonksiyonu-1.jpg" alt="SQL Server'da Tarih Kontrolü Fonksiyonu" width="700" height="556" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2021/11/sql-serverda-tarih-kontrolu-fonksiyonu-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2021/11/sql-serverda-tarih-kontrolu-fonksiyonu-1-315x250.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2021/11/sql-serverda-tarih-kontrolu-fonksiyonu-1-378x300.jpg 378w, https://sqlserveregitimleri.com/wp-content/uploads/2021/11/sql-serverda-tarih-kontrolu-fonksiyonu-1-170x135.jpg 170w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere tarih kontrolü gerçekleşmiş oldu.</p>
<p>Herkese çalışma hayatında ve yaşamında başarılar kolaylıklar.</p>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 260</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
