Reusable statements in queries

T

t2b

Many queries in a database I am working in may have the same statement such as:

NewValue: IIf([Field1] Is Null,[Field2],[Field1])

What is the best way to store and call statements such as this?
 
A

a a r o n . k e m p f

put your logic inside SQL Server and just use User-Defined Functions.
 
A

Access Developer

I've heard of Johnny One-Note
(http://www.stlyrics.com/lyrics/babesinarms/johnnyonenote.htm) but, lo and
behold, here's Aaron One-Answer haunting the zombie newsgroups with his
one-and-only answer: "switch to SQL Server". Of course, he neglects to
mention that you can use functions in Access, Jet and ACE, without having to
switch.

Things must be really slow in Aaron's neighborhood if he has to try to trash
already-cancelled Microsoft-sponsored newsgroups. Hope you have a better
weekend than the week that drove you here, Aaron.

--
Larry Linson
Microsoft Office Access MVP
Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

a a r o n . k e m p f @ g m a i l . c o m said:
put your logic inside SQL Server and just use User-Defined Functions.

Many queries in a database I am working in may have the same statement
such as:

NewValue: IIf([Field1] Is Null,[Field2],[Field1])

What is the best way to store and call statements such as this?
 

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