Can function be used within SQL statement?

R

Roth

Dear Excel experts,

I am struggling with calculations extracted from Access database with
Excel VBA. Is it possible to use custom function with SQL statement?

A normal SQL statement will be like;
SELECT A,B from C

Can I do the following with Excel VBA like;
SELECT function(A,B) from C

I have tried it but failed. I am not sure if this is because this
cannot be done in Excel or I didn't know the right way to do it.

Thank you very much in advance.
 
J

Joel

th efunction must include a database name where the macro is located.

db1.mdb!function(a,b)
 
P

Patrick Molloy

SELECT GetCoupon([Security]) FROM BondTables

raised an "Undefined Function" error in Excel,. In my Access database, its a
public function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top