I need to calculate a running balance for each row. The rows are sorted and the beginning balance 167230 is given.
My job is to use 167230 as the beginning balance and calculate the rest of the balances by date.
The formular is: daily bal = prev bal - Amt1 + Amt2 + Amt3
Here is the sample...
Hello gmmastros and simiana336,
Yes, it was a follow up of my previous question.
I like all these ideas.
I am going to try them and get back with you all.
Thank you all for helping.
My problem is don't knw how to deal with the BegDt and EndDt.
Should I use CAST or CONVERT?
How do I construct the SET @SQLCmd line for it to work with the passing values?
How do I construct the EXEC sp_EXECUTESQL @SQLCmd line so that values will pass properly?
Thanks.
This is the first time I do dynamic query. I have a hard time to figure this out. Please help.
I am trying to walk through 10 different db in a SQL server with one query to pull the sales data into a collective table in Corpdb.
We have 10 stores and each store is a db in the server with the same...
I am working on a project that I have to select the same table from each store and say, print a report with the query results. I am trying to use just one Stored Procedure by passing differnet city name to it.
The problem is that I can't swtich from db to db. I tried DECLARE @City in different...
I am having problems in using Access 2000 ADP to show a graph on a form. I tried to show a bar graph of daily sales for two stores for a selected month.
The Sales2StoreGraph_sp query that I am using is:
SELECT
CONVERT(char(10), BusinessDate, 101) as BDate,
ROUND StoreASales as A,
ROUND...
Thank you for helping.
I have a need to read a sql 2005 table and do something with the data and insert the records to a sql 2008 table all in one c# program.
Is it possible for a C# program to access 2 versions of SQL? If not, would you please give me some suggestions.
Thanks again.
Hello,
I have a table storing daily sales of our four stores. I need to create a sales report showing only sales on the last day of every month for each store going back as far as we can.
I tried MAX(day(SalesDate)) and it is not working.
Select Max(day(SalesDate), StoreLoc, SalesAmt
FROM Sales...
Hello,
Is it possible to have sql to transalte a code to a text?
I have a PROPERTY table and it has an int field VACANT which is either 0 or 1.
SELECT Address, KepMap, VACANT
FROM PROPERTY
WHERE CITY = 'Dallas'
What I want to show is the word Vacant or Occupied rather than a 0 or 1...
I have made some changes to an existing stored procedure. I pressed F5. I thought it should update my sp's content only and should not execute the statements in it. My question is does SQL Server execute the SELECT and stuff in the procedure when I pressed F5 with the ALTER statement?
Thanks...
Hollo all,
Just curious, I am collecting sales data from 20 remote locations into a table (AllSales), and then I pivot the table into summaries and totals for reporting.
I have been struggling with the dilemma of should I define the AllSales table with key or without key. From user retrieval...
George,
You are right. I interpret the "Output parameter" as the outcome from the query. I think that's what my mistake was.
Now I understand that it means anything that I want as a result of the SP.
It will work for me. Thanks for helping.
Ed
I have a store procedure (SQL 2000) return a (0) found and (1) not found value. Did I do the sp correctly? How do I check the return value in Access ADP? Thank you very much.
The Store procedure:
ALTER PROCEDURE Chk_ZipCoverage
/* =============================================
Create...
Borislav,
Thank you for your help. How do I capture the quantity in my Access ADP program. For example:
Dim....
Dim intQuantity as integer
...
...
DECLARE @Test numeric(14,0)
EXEC GetQuantity_sp 'SomeName', 'Location', @Test OUTPUT
intQuantity = SELECT @Test
msgbox "There are " & intQuantity &...
Hi all,
I am trying to develop a SP for looking up the Quantity of a specific item at a specific warehouse. My idea is to pass the Item Name and Warehouse Location to the SP and have it return the Quantity.
CREATE GetQuantity_sp
-- =============================================
-- Create date...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.