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 bkrike 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 Lftsk

  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.

Part and Inventory Search

Back
Top