Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wpforms-lite domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the businext domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the businext domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/ragipunal.com/wp-includes/functions.php on line 6114
Bulunduğumuz Ayın Birinci gününden ve Bugününe Kadar Olan Satışların Listelenmesi T-SQL Kodu - RAGIP ÜNAL

Blog

Bulunduğumuz Ayın Birinci gününden ve Bugününe Kadar Olan Satışların Listelenmesi T-SQL Kodu

Merhabalar,

Uzun bir süredir yazmıyordum ama bu yazımla güzel bir başlangıç daha yapmış olacağımı düşündüm.

Güzel ve yararlı bir kod yazdığımın düşüncesindeyim. Çözümpark’ta bu şekilde bir soru sorulmuştu ona binaen yazdım ve blogumdaki ziyaretçilerle paylaşmak istedim. İşte kodlar…

/* Tablomuzu oluşturalım */
Create table satis (
sts_id int identity(1,1) primary key,
sts_tarih datetime,
sts_isim varchar(100)
)
Go

/* Tablomuzu dolduralım */
DECLARE @Counter Int
SET @Counter = 0
DECLARE @DateTime Datetime
SET @DateTime = GETDATE()
WHILE @Counter < 1000
   BEGIN
     INSERT INTO satis (sts_tarih,sts_isim) SELECT @DateTime-@Counter,'Ürün '+CONVERT(varchar(10),@Counter)
     SET @Counter = @Counter + 1
END
Go

/* Tabloda bulundugumuz ayın birinden, bugüne kadar olan satışları listeleyelim */
Select * from satis Where sts_tarih between CONVERT(date,GETDATE()-day(getdate())+1,105) AND CONVERT(date,getdate(),105)
Go

/* Tablomuzu silelim */
Drop table satis
Go

Leave A Comment

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir