View Single Post
Old 09-17-2019, 02:59 AM   #1
Auntiejack56
Newly Registered User
 
Join Date: Aug 2017
Posts: 30
Thanks: 2
Thanked 3 Times in 3 Posts
Auntiejack56 is on a distinguished road
Calculated Fields in SQL

Hi all,
There was a time when this query would give an error, because you couldn't use a calculated field in a second calculation in the same query:
SELECT Len([EntrantName])*[EntrantID] AS EntrantCode, tblEntrants.EntrantName, IIf([EntrantCode]>50,[EntrantCode],[EntrantName]) AS EntrantDescription
FROM tblEntrants;
The SQL itself is just for illustration purposes (it works but has no real world application), but the point is that one calculated field, EntrantCode, is used in a second calculation for EntrantDescription.
My question is that I now have some quite complex calculations that I would like to use in a single query, but I'm hesitant to do so in case the results are subject to limitations that I may not be aware of. Can anyone advise?
Thanks,
Jack

Auntiejack56 is offline   Reply With Quote