I tried the above but substituted T.PAYEE CODE - error "Invalid column name 'PAYEE'"
Then I removed the AS PAYEE:
SELECT MAX(TRANS_ENTRY_DATE) AS LATEST_TRANS,
PAYEE_CODE,
PAYEE_NAME,
CLIENT_CODE
FROM (
SELECT
T.TRANS_ENTRY_DATE,
T.PAYEE_CODE,
P.PAYEE_NAME,
C.CLIENT_CODE
FROM...
P.PAYEE_CODE can't be used but when I use either P.PAYEES_ID or T.PAYEE_CODE it returns the correct columns but 1M+ rows and I am expecting 610 rows.
Thanks
The query that works:
SELECT
max(T.TRANS_ENTRY_DATE)AS LATEST_TRANS,
T.PAYEE_CODE,
P.PAYEE_NAME
FROM
[xx].[xx].[dbo].[SQL_PREMIUMS_TRANSACTION_CODE] T
INNER JOIN [xx].[xx].[dbo].[SQL_PAYEES] P ON T.PAYEE_CODE = P.PAYEES_ID
INNER JOIN [xx].[xx].[dbo].[SQL_CLIENTS] C ON T.BILLTO_ID =...
Thanks for your speedy reply Andy
I corrected my error:
FROM {PREMIUMS_TRANSACTION] TRANS to T and removed the where clause but I am still getting
Incorrect syntax near 'CLIENT_CODE' the last line.
What am I missing?
I am using SQL 2008R2 and need some assistance.
This query gives me the result I need except the CLIENT_CODE (in the C table) that corresponds with the LASTEST_TRANS:
SELECT
max(T.TRANS_ENTRY_DATE)AS LATEST_TRANS,
P.PAYEE_CODE,
P. PAYEE_NAME
FROM
{PREMIUMS_TRANSACTION] TRANS
INNER JOIN...
SSRS 2008R2
Hello,
I need to have the results of a certain ID it one row rather than multiple rows.
SQL (Simplified):
SELECT ID, CAST(CONTACTDATE AS DATE) AS 'DT', DESCRIPTION, CAST(ASSOC_ROW AS INT) AS 'ROW'
FROM SERVER.dbo.TABLE
ORDER BY 'DT', 'ROW'
Expression in SSRS - used in the group...
Tried both with no luck. No leading or trailing spaces in the Column Heading.
Maybe I missing something else? I can still bring in the values using the text box with my initial code/post.
Member is only one column (not Member plus ID or something else)
I am expecting the drop-down to pull up the Member name and associated other columns from the stored procedure.
I was trying to convert the input box (which worked) to a drop down.
I'm probably the one that's missing something! I...
Private Sub ComboBox1_Change()
Dim Customer As String
Member = Sheets("Sheet1").Range("K8").Value
With ActiveWorkbook.Connections("ABCWEB2 SQLReports sysdiagrams").OLEDBConnection
.CommandText = "EXEC dbo.usrsp_S_Customer_Census '" & Customer & "'"
ActiveWorkbook.Connections("ABCWEB2...
Hate to keep bothering you but is this on the right track? (Though the data is not populated in the combo box yet.)
Private Sub ComboBox1_Change()
Dim Member As String
Member = Sheets("Sheet1").Range("K8").Value
With ActiveWorkbook.Connections("ABCWEB2 SQLReports...
I don't know if it would work for this purpose. The whole process can't change drastically or the users won't use this. They need to just fetch the data, save as, and go from there.
If I understand the question, the Excel workbook with associated tables will not be rebuilt repeatedly. I want to query SQL to pull in the selected "Customer" records. After the records are displayed, the user will remove the data connection and save the workbook with the records.
Skip,
Thanks for your quick response.
I feel this is obvious for others but I think I need a bit more assistance as I am new to this in Excel.
After I add a Combo Box control, how do I get to the row source of the control object to reference the Range Name? Is it possible for you to use my...
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.