Maybe a simple question

  • Thread starter Fiammenghi Fabrizio
  • Start date
F

Fiammenghi Fabrizio

Hi to all,
sorry to bother but I can't find a solution.
I've to build a query in ms access 7.0 that select some fields from a table.
In add the query should show a column (esperssion) with a default numeric
value and I need to specify this default value in the query, and I don't
want that access ask for the value.

for example :
SELECT DISTINCTROW Agent.*, [qq] AS Espr1 FROM Agent;

Access ask me for qq value but I'd like to pass this value directly in the
sql statement.
Is it possible ?

Many thanks in advance.

Fabrizio
 
M

Matthias Klaey

Fiammenghi Fabrizio said:
Hi to all,
sorry to bother but I can't find a solution.
I've to build a query in ms access 7.0 that select some fields from a table.
In add the query should show a column (esperssion) with a default numeric
value and I need to specify this default value in the query, and I don't
want that access ask for the value.

for example :
SELECT DISTINCTROW Agent.*, [qq] AS Espr1 FROM Agent;

Access ask me for qq value but I'd like to pass this value directly in the
sql statement.

[...]

Use the number instead of the [qq], e.g.,

SELECT DISTINCTROW Agent.*, 23 AS Espr1 FROM Agent;

HTH
Matthias Kläy
 
D

Dennis

Try this (I haven't checked that it works)
for a numeric default use
SELECT DISTINCTROW Agent.*, 1 AS Espr1 FROM Agent;

for text use
SELECT DISTINCTROW Agent.*, '1' AS Espr1 FROM Agent;
 
F

Fiammenghi Fabrizio

Thanks to all.
it worked.

Best regards
Fabrizio


Dennis said:
Try this (I haven't checked that it works)
for a numeric default use
SELECT DISTINCTROW Agent.*, 1 AS Espr1 FROM Agent;

for text use
SELECT DISTINCTROW Agent.*, '1' AS Espr1 FROM Agent;

Fiammenghi Fabrizio said:
Hi to all,
sorry to bother but I can't find a solution.
I've to build a query in ms access 7.0 that select some fields from a
table.
In add the query should show a column (esperssion) with a default numeric
value and I need to specify this default value in the query, and I don't
want that access ask for the value.

for example :
SELECT DISTINCTROW Agent.*, [qq] AS Espr1 FROM Agent;

Access ask me for qq value but I'd like to pass this value directly in
the
sql statement.
Is it possible ?

Many thanks in advance.

Fabrizio
 
Top