Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized SQL View
Message
 
 
To
29/04/2009 07:22:22
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01396883
Message ID:
01396886
Views:
77
This message has been marked as the solution to the initial question of the thread.
Make it into table-valued UDF.

>
>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform