Re: how to create a function w/in a query?
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 20 Jan 2007 11:15:30 -0700
On 20 Jan 2007 09:15:14 -0800, "ash" <ash477@xxxxxxxxxxx> wrote:
Using Access ('07 I have now - but doesn't matter) - lets say i have 2
tables
Table1, with fields a,b,c
Table2, with fields h,i,,j
I want a query that does something like this:
select a, b, c, function( select j from Table2 where c =h)
from Table1
Something like that. Basically, I know how to do this in oracle. I
can call an oracle function within a select statement, and bring some
value back from another table. I can even pass in a value from the
select, into the function - if I recall correctly. Anyhow, I want to
know how i can do this with Access. (I'm using Access 2007 - but i dont
think the queries are much different from '03). I'm somewhat new to
access queries, so any help or pointing me to a site that shows this,
would be great!
Ash
Oracle and SQL/Server let you mix programming language constructs with
SQL queries... but Access doesn't. What you can do is create a
function in VBA, by creating a new Module; and you can call that
function from a Query. You can pass *values* - strings, numbers, etc.
- but (other than passing a SQL string and having code in your
function that parses it) you can't pass a SQL statement.
John W. Vinson[MVP]
.
- Follow-Ups:
- References:
- how to create a function w/in a query?
- From: ash
- how to create a function w/in a query?
- Prev by Date: Re: Query help, date criteria
- Next by Date: RE: runtime error record is deleted
- Previous by thread: how to create a function w/in a query?
- Next by thread: Re: how to create a function w/in a query?
- Index(es):
Relevant Pages
|