Variables in select statement

J

Jarryd

Hi,

How do you declare variables in an Access 2007 SELECT statement?

I want to do something like:
Dim PCLine as Integer
SET PCLine = 0
SELECT IIf(Col1 = 1, "Cool", PCLine = Col1) AS Example;

TIA,

Jarryd
 
T

Tom van Stiphout

On Tue, 26 Jan 2010 13:11:43 -0000, "Jarryd" <[email protected]>
wrote:

SQL Is not appropriate for that; it is to operate on data in your
tables. For data and variables in code, use VBA.

-Tom.
Microsoft Access MVP
 

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