Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. OldSlowDog

    Calculate running balance

    SQL 2005 Thanks
  2. OldSlowDog

    Calculate running balance

    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...
  3. OldSlowDog

    Could not make it work

    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.
  4. OldSlowDog

    Could not make it work

    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.
  5. OldSlowDog

    Could not make it work

    Because I am pulling data off each db into a collective table that's why I use a new field 'Storeid' to identify which store is which.
  6. OldSlowDog

    Could not make it work

    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...
  7. OldSlowDog

    using diffenet db one at a time

    Two of you are great! I like the suggested enhancement by looping through the city table. Sincerely thank you all. Have a great day!
  8. OldSlowDog

    using diffenet db one at a time

    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...
  9. OldSlowDog

    Can't make a Bar Graph

    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...
  10. OldSlowDog

    Accessing sql 2005 and sql 2008

    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.
  11. OldSlowDog

    select only the last day of any month

    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...
  12. OldSlowDog

    show Vacant when 1

    Amazing! Thank you.
  13. OldSlowDog

    show Vacant when 1

    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...
  14. OldSlowDog

    Alter a stored procedure

    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...
  15. OldSlowDog

    Key or no Key

    Thank you all. That's what I'll do.
  16. OldSlowDog

    Key or no Key

    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...
  17. OldSlowDog

    Return value from SP

    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
  18. OldSlowDog

    Return value from SP

    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...
  19. OldSlowDog

    returning a value from stored procedure

    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 &...
  20. OldSlowDog

    returning a value from stored procedure

    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...

Part and Inventory Search

Back
Top