![]() |
Stok seçim ekranı (F10) |
Post Reply ![]() |
Author | |
star ![]() Yeni Üye ![]() Joined: 07 Şubat 2008 Location: şirinevler Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 07 Şubat 2008 at 13:21 |
Merhabalar,
Stok seçim ekranında (f10) da yeni bir view yapmak istiyorum.Bu view de depo fiyatları ve depo miktarlarını görüntülenmesini istiyorum.Forum içersinde aradım ama bulamadım acaba yardım edebilecek bir arkadaş var mı?
![]() |
|
![]() |
|
@thlon ![]() Senior Member ![]() ![]() Joined: 03 Aralık 2004 Location: İstanbul Status: Offline Points: 544 |
![]() ![]() ![]() ![]() ![]() |
Merhaba Star;
Dediğinizi v10 için yapmıştım mantık aynı sadece alan adlarını v12 ye göre uyarlaman gerekir. Şu an fazla vaktim yok düzenleyemezsen yazarsan v12 için olan halini de atarım.İyi çalışmalar.
SELECT TOP 100 PERCENT sto_RECno AS [KAYIT NO], sto_kod AS KODU, sto_isim AS ADI, sto_fiat1_tutar AS FİYAT, dbo.fn_EldekiMiktar(sto_kod) AS MİKTAR,
(SELECT TOP 1 sdp_fiat1_tutari FROM dbo.STOKDEPO WITH (NOLOCK) WHERE sdp_depo_kod = sto_kod AND sdp_depo_no = 2) AS [DEPO1/ FİYAT1], dbo.fn_DepodakiMiktar(sto_kod, 1, NULL) AS [DEPO1 /MİKTAR], (SELECT TOP 1 sdp_fiat1_tutari FROM dbo.STOKDEPO WITH (NOLOCK) WHERE sdp_depo_kod = sto_kod AND sdp_depo_no = 3) AS [DEPO2/ FİYAT1], dbo.fn_DepodakiMiktar(sto_kod, 2, NULL) AS [DEPO2/MİKTAR], (SELECT TOP 1 sdp_fiat1_tutari FROM dbo.STOKDEPO WITH (NOLOCK) WHERE sdp_depo_kod = sto_kod AND sdp_depo_no = 4) AS [DEPO3/ FİYAT1], dbo.fn_DepodakiMiktar(sto_kod, 3, NULL) AS [DEPO3 /MİKTAR] FROM dbo.STOK WITH (NOLOCK) ORDER BY sto_kod |
|
megahertz is nothing performance is every thing
Turgut YILMAZ @thlon MCP,MCTS |
|
![]() |
|
star ![]() Yeni Üye ![]() Joined: 07 Şubat 2008 Location: şirinevler Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
@thlon Merhaba,
ilgine teşekkür ederim ama düzenleme için yeterli bilgim yok.Yapabilirsen çok iyi olur.Şimdiden teşekkür ederim.
|
|
![]() |
|
Maral Anadol ![]() Yönetici ![]() ![]() Joined: 15 Haziran 2004 Location: İstanbul Status: Offline Points: 773 |
![]() ![]() ![]() ![]() ![]() |
V12 tablo ve alan açıklamaları için http://yardim.mye.com.tr/ 'den Mikro veritabanı yapısı / Mikro veritabanı yapısı V12 'deki Tablolar ve alanlar linkini inceleyiniz.
Mesela dbo.STOK yerine v12'de dbo.STOKLAR olacak.
|
|
![]() |
|
tatlıcadı35 ![]() Senior Member ![]() ![]() Joined: 10 Haziran 2005 Location: İZMİR/KSK Status: Offline Points: 2339 |
![]() ![]() ![]() ![]() ![]() |
yani sayın kürkçü şunu diyor v11 database yapısıile v12 arasındaki fark sadece LAR eklendi.
![]() |
|
![]() |
|
star ![]() Yeni Üye ![]() Joined: 07 Şubat 2008 Location: şirinevler Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
Sanırım fark sadece lar ile kalmıyor mesela dbo.stok_satis_fiyat_listeleri diye bir tablo eklenmiş ki bu da tüm sorguyu etkiliyor.
|
|
![]() |
|
Maral Anadol ![]() Yönetici ![]() ![]() Joined: 15 Haziran 2004 Location: İstanbul Status: Offline Points: 773 |
![]() ![]() ![]() ![]() ![]() |
Evet tek fark; "lar" değil
![]() |
|
![]() |
|
star ![]() Yeni Üye ![]() Joined: 07 Şubat 2008 Location: şirinevler Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
@thlon bakabildin mi acaba?
|
|
star
|
|
![]() |
|
cuneytekti ![]() Senior Member ![]() ![]() Joined: 15 Kasım 2007 Location: Turkey Status: Offline Points: 278 |
![]() ![]() ![]() ![]() ![]() |
SELECT TOP 100 PERCENT
STOK.sto_RECno AS [KAYIT NO], STOK.sto_isim AS ADI, STOK.sto_kod AS KODU, dbo.fn_Depofiyat(STOK.sto_kod,1) as [KSP DEPO FIYATI],dbo.fn_DepodakiMiktar(STOK.sto_kod,1,'') as [KSP DEPO MIKTARI], dbo.fn_Depofiyat(STOK.sto_kod,2) as [CGL DEPO FIYATI],dbo.fn_DepodakiMiktar(STOK.sto_kod,2,'') as [CGL DEPO MIKTARI], dbo.fn_Depofiyat(STOK.sto_kod,3) as [CKZ DEPO FIYATI],dbo.fn_DepodakiMiktar(STOK.sto_kod,3,'') as [CKZ DEPO MIKTARI] FROM STOK ORDER BY STOK.sto_isim |
|
![]() |
|
cuneytekti ![]() Senior Member ![]() ![]() Joined: 15 Kasım 2007 Location: Turkey Status: Offline Points: 278 |
![]() ![]() ![]() ![]() ![]() |
sorgu yukarda bu sorgunun çalışması için bir fonction var onuda eklemen gerek ..
oda aşşağıda ; SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER FUNCTION dbo.fn_Depofiyat(@sdp_depo_kod as varchar(25),@sdp_depo_no as int) RETURNS varchar(25) AS BEGIN declare @d as Float set @d = '' select @d=sdp_fiat1_tutari FROM dbo.STOKDEPO WITH (NOLOCK) WHERE sdp_depo_kod=@sdp_depo_kod and sdp_depo_no=@sdp_depo_no Return @d END GO SET QUOTED_IDENTIFIER OFF GO SET ANSI_NULLS ON GO |
|
![]() |
|
cuneytekti ![]() Senior Member ![]() ![]() Joined: 15 Kasım 2007 Location: Turkey Status: Offline Points: 278 |
![]() ![]() ![]() ![]() ![]() |
verdiğim fonkisyondaki depoları kendi depolarına göre uyarlaman gerek
|
|
![]() |
|
star ![]() Yeni Üye ![]() Joined: 07 Şubat 2008 Location: şirinevler Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() |
Cüneytekti yardımın için teşekkür ederim.Sanırım senin gönderdiğin view ve stored procedure v11 e göre düzenlenmiş ama ben ondan yola çıkarak v12 ye göre düzenledim.İhtiyacı olan arkadaşlar için aşağıdadır. Kolay gelsin.
View :
SELECT TOP 100 PERCENT
sto_RECno AS [msg_S_0088] /* KAYIT NO */ , STOKLAR.sto_isim AS [ADI], STOKLAR.sto_kod AS [KODU], dbo.fn_Depofiyat(STOKLAR.sto_kod,0)AS [GENEL DEPO FIYATI], dbo.fn_DepodakiMiktar(STOKLAR.sto_kod,0,'')AS [GENEL DEPO MIKTARI], dbo.fn_Depofiyat(STOKLAR.sto_kod,1)AS [DEPO1 FIYATI], dbo.fn_Depofiyat(STOKLAR.sto_kod,2)AS [ DEPO2 FIYATI], stored procedure : set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo
ALTER FUNCTION [dbo].[fn_Depofiyat](@sfiyat_stokkod as varchar(25),@sfiyat_deposirano as int)RETURNS varchar(25) ASBEGIN declare @d as Float set @d = '' select @d=sfiyat_fiyati FROM dbo.STOK_SATIS_FIYAT_LISTELERI WITH (NOLOCK) WHERE sfiyat_stokkod=@sfiyat_stokkod and sfiyat_deposirano=@sfiyat_deposirano Return @dEND |
|
![]() |
Post Reply ![]() |
|
Tweet |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |