Is there any way I can accomplish the following?
I am connecting to Oracle through MS QUERY
Set Query = QuerySheet.QueryTables("MONEY")
Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH') AS MONTH, SUM(NUMB_TBLE.NUMB_PAY) " _
& "FROM JES.NUMB_TBLE NUMB_TBLE...
It didn't work; It grouped the data by each date.
For example if there were 10 January records, the result contained 10 records.
The purpose of the query is to sum the data by month.
There should have been one record for January
It didn't work. Also the column has an alias
I tried
Set Query = QuerySheet.QueryTables("MONEY")
Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH') AS MONTH, SUM(NUMB_TBLE.NUMB_PAY) " _
& "FROM JES.NUMB_TBLE NUMB_TBLE,
JES.NUMB_DATES_TBLE NUMB_DATES_TBLE" _...
I am connecting to Oracle through MS QUERY. The result is put into excel.
Set Query = QuerySheet.QueryTables("MONEY")
Query.Sql = "SELECT NUMB_TBLE.NUMB_NAME, TO_CHAR(NUMB_DATES_TBLE.DAY_MTH_YR, 'MONTH'), SUM(NUMB_TBLE.NUMB_PAY) " _
& "FROM JES.NUMB TBLE NUMB TBLE,
JES.NUMB_DATES_TBLE...
If I add an ORDER BY to my SELECT statement, the data in the columns get sorted.
I do not want to sort the data.
I want to alias the some of the columns to make the names more user-friendly.
When I alias a column, it changes the placement of the columns in the result.
For example if my...
I would like to put column aliases on some of the fields in the SELECT statement.
Private Sub CommandButton1_Click()
Dim NumList As String
Dim SourceBook As Workbook
Dim ListSheet As Worksheet
Dim QuerySheet As Worksheet
Dim Query As QueryTable
Dim Numb As String
Set SourceBook =...
Private Sub CommandButton1_Click()
Dim NumList As String
Dim SourceBook As Workbook
Dim ListSheet As Worksheet
Dim QuerySheet As Worksheet
Dim Query As QueryTable
Dim Numb As String
Set SourceBook = Application.ActiveWorkbook
Set ListSheet = SourceBook.Worksheets("Main")
Set QuerySheet =...
I am using a spreadsheet. It has two tabs MAIN and TOTAL CASH. On the MAIN tab is a BUTTON and a cell where to enter a number. After you put a number in the cell and click the button, the results of the query is in the tab TOTAL CASH
Private Sub CommandButton1_Click()
Dim NumList As String
Dim...
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.