Good Morning,
I have an unusual problem that I'm hoping you can help me with. I'm trying to modify an existing excel connection to an sql database that the spreadsheet queries.
There is a table in the spreadsheet that I can right click on and look at the sql query that is attached to it. It is as follows:
select <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
c.New_FileNumber as [FileNumber]<o></o>
,p.new_paymentdate as [Date]<o></o>
, p.New_PaymentAmount as [Amount]<o></o>
, p.new_paytypename as [PayType]<o></o>
, p.new_typedetail as [TypeDetail]<o></o>
, ISNULL(p.New_name, '') as [Memo]<o></o>
from FilteredNew_payment p<o></o>
join FilteredContact c on c.ContactId = p.new_clientid<o></o>
where p.New_TypeDetail not in(27)<o></o>
and c.New_FileNumber = 'G105407'
What I need to do is pass a new file number to the query in the line: c.New_FileNumber = 'G105407' via a macro. That way I can change the customer data that the query finds with an input box where the user can type in a customer id number.
I admittedly am over my head in this. I know nothing about sql or excel connections to external databases and would appreciate any help you can give me on this. To me it seems to be a simple problem of passing a number to the query. However, I'm well aware that simple problems can become very complex at the drop of a hat.
Thank you for your time and any help you can give me in this regard.
JDeiley
I have an unusual problem that I'm hoping you can help me with. I'm trying to modify an existing excel connection to an sql database that the spreadsheet queries.
There is a table in the spreadsheet that I can right click on and look at the sql query that is attached to it. It is as follows:
select <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
c.New_FileNumber as [FileNumber]<o></o>
,p.new_paymentdate as [Date]<o></o>
, p.New_PaymentAmount as [Amount]<o></o>
, p.new_paytypename as [PayType]<o></o>
, p.new_typedetail as [TypeDetail]<o></o>
, ISNULL(p.New_name, '') as [Memo]<o></o>
from FilteredNew_payment p<o></o>
join FilteredContact c on c.ContactId = p.new_clientid<o></o>
where p.New_TypeDetail not in(27)<o></o>
and c.New_FileNumber = 'G105407'
What I need to do is pass a new file number to the query in the line: c.New_FileNumber = 'G105407' via a macro. That way I can change the customer data that the query finds with an input box where the user can type in a customer id number.
I admittedly am over my head in this. I know nothing about sql or excel connections to external databases and would appreciate any help you can give me on this. To me it seems to be a simple problem of passing a number to the query. However, I'm well aware that simple problems can become very complex at the drop of a hat.
Thank you for your time and any help you can give me in this regard.
JDeiley