Maybe a simple question

  • Thread starter Thread starter Fiammenghi Fabrizio
  • Start date 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
 
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
 
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;
 
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
 

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

Back
Top