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: *

  • Users: Lftsk
  • Order by date
  1. Lftsk

    A simple Select Statement

    Hello, I have a simple problem that I can't seem to figure out. I have a table (tblTrans) that has records from the past 3 years. Each record is dated (TransDate). I need a Select Statement that will give me all of the records for the month prior to the current month. This is easy enough...
  2. Lftsk

    Renaming an excel WorkSheet ina DTS ActiveX Script?

    Hello, I have an DTS ActiveX script that deletes, creates and populates an excel worksheet in the same .xls file on a weekly basis. The problem I'm running into is renaming the spreadsheet after I add it into the Worksheets collection. Any help is appreciated. My code is below: Set...
  3. Lftsk

    Hello all, I hope someone here c

    Unfortunately I can't. The length of the field in the MySQL database is fixed and can't be changed. And I'm not even defining the length in the MS SQL database. It's just a Select statement. SELECT * FROM OPENQUERY(DataMiner, 'SELECT addr_zip FROM tblProviders') Do you know of any problem...
  4. Lftsk

    Hello all, I hope someone here c

    Hello all, I hope someone here can help me. Here's my problem I have 2 Databases. One in MySQL and another in SQL Server. I am trying to link the MySQL Server into SQL Server using the MySQL ODBC driver 3.51. It appears to do so successfully until I try to run a query on any table in the...
  5. Lftsk

    Passing Date to a Stored Proc from an ASP page

    I hope someone can help me. I'm trying to pass a date range (from and to) from 2 text boxes on an ASP page to a stored procedure bu the recordset keeps coming back empty when I know there is at least one record in there. I'm using the ADO command object as follows: FromDate =...
  6. Lftsk

    Combining 2 rows from same table?

    Thank you all. The example that worked best for me was ClaireHsu's. I had to modify it a little but it's fine. Now I have to place it in a Stored Proc and pass parameters, so I can get the recordset back. Thanks again!
  7. Lftsk

    Combining 2 rows from same table?

    Hello, I hope someone can help me. I have a table. For example's sake, it has 4 columns. In actuality, it has 15. The structure is Date smalldatetime (Primary Key) Total1 money Total2 money Total3 money (table actually has 14 different "Total" columns) The Date column will...
  8. Lftsk

    Hello, I need help with a SELECT

    Sorry I could have been more clear. Let's say I have 8 rows in the table. Row RecType Col1 Col2 Col3 1 A 100 200 300 2 A 100 200 400 3 B 100 200 300 4 B 100 200 500 5 C 100 200 300 6 C 100 200 600...
  9. Lftsk

    Getting last day of the current month

    This should give you the Beginning of the current month SELECT GETDATE() - DATEPART(d, GETDATE()) + 1 This should give you the ending date of the current month. SELECT DATEADD(m, 1, GETDATE()) - DATEPART(d, DATEADD(m, 1, GETDATE()))
  10. Lftsk

    Hello, I need help with a SELECT

    Hello, I need help with a SELECT Statement. I have a table with 4 columns. Column 1 is RecType ("A", "B", "C", "D") Column 2 is Col1 Column 3 is Col2 Column 4 is Col3 All I need is one record per RecType. Each record is the highest value in Col3 for...
  11. Lftsk

    Initializing a Table in DTS

    Thanks. I probably won't do it if that is the case. But if I do. What is the trick? Where do I go within DTS to truncate the table?
  12. Lftsk

    Initializing a Table in DTS

    Hello, I have a table whose contents are deleted and the table is then re-populated once a week via DTS. I believe there is a property (or some other way) in DTS that will automatically delete the contents of the table before re-populating other than an SQL task of "DELETE FROM...
  13. Lftsk

    Using SELECT CASE in conjunction with GROUP BY

    Thank You. Once Again, you've solved my problem. Thanks again.
  14. Lftsk

    Using SELECT CASE in conjunction with GROUP BY

    I have an SQL Statement: SELECT a.SERVER, a.OFFICE, a.LOCATION, a.[Office Name], a.[GL Code], RecType = CASE a.AcctBal WHEN >= 0 THEN 'D' WHEN < 0 THEN 'C' END, a.CLOSEDATE, 0 AS BegTotBal, 0 AS BegRecBal, SUM(a.AcctBal)...
  15. Lftsk

    Getting Top 25 records for each group

    Thanks, that would work execept for example's sake I said only 4 categories. I actually have over 140. So manually entering each category would be somewhat cumbersome. Thanks again.
  16. Lftsk

    Getting Top 25 records for each group

    I have a table (tblAccts). It has 3 columns (AcctNo, Category, Balance). There are 4 possible choices (A, B, C, D) for the category column. I need to get the top 25 rows (based on the dollar amount in the Balance column) in each category. I don't want them grouped together. I just need my...
  17. Lftsk

    Updating a table

    Just wanted to say THANK YOU! It worked perfectly. Can't tell you how much this helped me. Thanks again.
  18. Lftsk

    Updating a table

    Thanks so much! This helps out quite a bit. The answer to your first question is I would be updating, not inserting. I think this is quite close to solving it. Just one thing and correct me if I'm wrong, but doesn't the above solution create a row for each record in Table1? I think the...
  19. Lftsk

    Updating a table

    Sorry I should have been more specific. Each Transaction in table1 (along with it's 4 column key) has a date column and a Transaction Type column. If the Transaction Type Column is a 'C' then it's a charge - if it's a 'P', it's a payment. In table2 I have 13 columns (in addition to it's 4...
  20. Lftsk

    Updating a table

    I have an issue, I'm not sure how to solve. I have 2 tables - table1 and table2 They both have the same 4 column primary key - K1, K2, K3 and K4. Table1 is a transaction table that contains charges and payments for the past year. Table2 is a summary table that in addition to the key contains...

Part and Inventory Search

Back
Top