From: Jarryd on
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
From: Tom van Stiphout on
On Tue, 26 Jan 2010 13:11:43 -0000, "Jarryd" <jarryd(a)nodomain.com>
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


>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