Edgar,
You reference the calculated field in the query by the name, for example
...
ORDER BY Dias ...
After table is created there is no difference between fields in it.
I also have some suggestion about your query:
- There's no join condition for the table 'helpdesk!festivos' and I don't see why you need it in this query at all.
- You don't need SYS(11) function to compare or substract date fields
- Expressions with EMPTY() function aren't Rushmore optimizable. It's better to compare date to the emty date constant.
SELECT distinct Llamadas.numero, Llamadas.ingeniero, ingeniero.codigo, ;
ingeniero.nombre AS ingeniero, Llamadas.fllamada, Llamadas.fcierre, ;
(Llamadas.fcierre-Llamadas.fllamada) AS Dias ;
FROM helpdesk!Llamadas, helpdesk!ingeniero ;
WHERE (Llamadas.fllamada BETWENN m.ini AND m.fin) ;
And Llamadas.ingeniero = ingeniero.codigo;
AND Llamadas.fllamada <> {} ;
AND Llamadas.fcierre <> {} ;
into table unotab.dbf
>Hello, i've created a table with a query, this is my query:
>
>
>I need to deal with the alias field Dias, i been trying with the unotab.dias, but its hopeless, am i doing something wrong?
>Please help.
>
>Thanks.
--sb--