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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by OldSlowDog

  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.

Part and Inventory Search

Back
Top