?
Solved

Stored procedure syntax

Posted on 2012-08-15
1
Medium Priority
?
501 Views
Last Modified: 2012-08-15
I am trying to combine two stored procedures I have but my syntax is wrong ... help ?

USE [BlueDotFinancial]
GO

/****** Object:  StoredProcedure [dbo].[Totalmonthlyexpenses]    Script Date: 08/15/2012 20:49:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Monthlytotalbalance]
AS
BEGIN

(Select  SUM ((c.BDotcut)*a.qty)
from dbo.Subscriptions a
inner join Clients as b on a.clientid = b.Clientid
inner join Services as c on c.Serviceid = a.serviceid
WHERE c.billedon = 'm')  -
(Select SUM (amount) as TotalExpenses
from Expenses
WHERE recurring = 'm')

AS Balance

END
0
Comment
Question by:Aleks
1 Comment
 
LVL 25

Accepted Solution

by:
lwadwell earned 2000 total points
ID: 38298851
Select (Select  SUM ((c.BDotcut)*a.qty)
from dbo.Subscriptions a
inner join Clients as b on a.clientid = b.Clientid
inner join Services as c on c.Serviceid = a.serviceid
WHERE c.billedon = 'm')  -
(Select SUM (amount) as TotalExpenses
from Expenses
WHERE recurring = 'm') as balance
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question