Constant in Access Query

  • Thread starter Thread starter tg
  • Start date Start date
T

tg

When running a query, I'd like to have the year appear as
a field. The problem is the Year field does not exist in
the table. So, I guess what I'm asking is how can I get a
constant in the query. Make sense? I just didn't want to
have to run an update query to get the data in the table.
thanks
 
You can type a calculated field.
Just type a value into the Field row, e.g.:
2003

If you want to name your field something a bit more meaningful than Expr1,
use:
ThisYear: 2003

You could also type an expression, e.g.:
ThisYear: Year(Date())
 
Wow. so simple. Thank you very much!
-----Original Message-----
You can type a calculated field.
Just type a value into the Field row, e.g.:
2003

If you want to name your field something a bit more meaningful than Expr1,
use:
ThisYear: 2003

You could also type an expression, e.g.:
ThisYear: Year(Date())

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.




.
 
Back
Top