D
Diego via AccessMonster.com
I have a query that take the Data_Nascita value from table Anagrafica.
In Expr1 i calculate the value in year, no problem.
Then i am tring to get the correct value of Categoria related to age value i
have the problem.
With this code a get always the first value in the table that is not
correlated to the age calculation and obviously is not correct.
SELECT Anagrafica.Data_Nascita, DateDiff("yyyy",[Data_Nascita],Date())-IIf
(Format([Data_Nascita],"mmdd")>Format(Date(),"mmdd"),1,0) AS Expr1, DLookUp
("Categoria","Anni_Categoria_Calcio_LND",[Expr1]) AS Categoria
FROM Anagrafica;
The table Anni_Categoria_Calcio_LND is like
Anni Categoria Descrizione
5 Cat_A Description A
6 Cat_B Description B
7 Cat_C Description C
.......
18 ...... ...............
The value of Categoria in the DLookUp is always the first, Cat_A also if the
age is 6, 7 ecc
Any idea ?
Thank you in advance
Diego
In Expr1 i calculate the value in year, no problem.
Then i am tring to get the correct value of Categoria related to age value i
have the problem.
With this code a get always the first value in the table that is not
correlated to the age calculation and obviously is not correct.
SELECT Anagrafica.Data_Nascita, DateDiff("yyyy",[Data_Nascita],Date())-IIf
(Format([Data_Nascita],"mmdd")>Format(Date(),"mmdd"),1,0) AS Expr1, DLookUp
("Categoria","Anni_Categoria_Calcio_LND",[Expr1]) AS Categoria
FROM Anagrafica;
The table Anni_Categoria_Calcio_LND is like
Anni Categoria Descrizione
5 Cat_A Description A
6 Cat_B Description B
7 Cat_C Description C
.......
18 ...... ...............
The value of Categoria in the DLookUp is always the first, Cat_A also if the
age is 6, 7 ecc
Any idea ?
Thank you in advance
Diego