Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized SQL View
Message
From
29/04/2009 07:22:22
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Parameterized SQL View
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01396883
Message ID:
01396883
Views:
91
Hi all

I have a view that calculates the Stock Balance upto current date. It is working for me.
SELECT     tmp.mcat_code, tmp.mat_code, Mat.mcat_desc, Mat.mat_desc, SUM(tmp.qty) AS qty
FROM         (SELECT     mcat_code, mat_code, SUM(qty) AS qty
                       FROM          mat_ob
                       GROUP BY mcat_code, mat_code
                       UNION
                       SELECT     mcat_code, mat_code, SUM(qty) AS qty
                       FROM         Purchase
                       GROUP BY mcat_code, mat_code
                       UNION
                       SELECT     mcat_code, mat_code, SUM((con_qty + wst_qty) * - 1) AS qty
                       FROM         Production
                       GROUP BY mcat_code, mat_code ) AS tmp INNER JOIN
                      Mat ON Mat.mcat_code + Mat.mat_code = tmp.mcat_code + tmp.mat_code
GROUP BY tmp.mcat_code, tmp.mat_code, Mat.mcat_desc, Mat.mat_desc
ORDER BY tmp.mcat_code, Mat.mat_desc
What i do if I want stock balance for certain date. Parameterized view? how to create it?

Zahid
Next
Reply
Map
View

Click here to load this message in the networking platform