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...
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...
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...
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...
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 =...
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!
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...
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...
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()))
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...
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...
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)...
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.
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...
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...
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...
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...
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.