Expression handling

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

A simple question, I think. I've created an expression (Week Number: Val(Format([Litiges Tbl]![Received],"ww"))) in my query and would like to use it further in the query. How can I refer to it to be able to perform further transformations on it in another field? (how do I have to call it?

Thank you

Daniel
 
Daniel P said:
Hello,

A simple question, I think. I've created an expression (Week Number:
Val(Format([Litiges Tbl]![Received],"ww"))) in my query and would like to
use it further in the query. How can I refer to it to be able to perform
further transformations on it in another field? (how do I have to call it?)

Unless you save that query and then use it as the input to a second query
you cannot do what you want. In the _same_ query you would have to repeat
the entire expression for the first field to be able to use it in the
second field. You cannot simply refer to the field alias name.
 
Actually this is no longer true in Access 2000 (and presumably later).

For example, something like this:

SELECT
Val(Format([Litiges Tbl].[Received],"ww")) AS [Week Number],
[Week Number] + 1 AS [Following Week]
FROM
[Litiges Tbl]

works for me (in Access 2000 SP-3).

Rick Brandt said:
Daniel P said:
Hello,

A simple question, I think. I've created an expression (Week Number:
Val(Format([Litiges Tbl]![Received],"ww"))) in my query and would like to
use it further in the query. How can I refer to it to be able to perform
further transformations on it in another field? (how do I have to call it?)

Unless you save that query and then use it as the input to a second query
you cannot do what you want. In the _same_ query you would have to repeat
the entire expression for the first field to be able to use it in the
second field. You cannot simply refer to the field alias name.
 
Back
Top