Query Syntax explaination (1 Viewer)

Salwa

New member
Local time
Tomorrow, 08:26
Joined
Oct 10, 2023
Messages
12
Hi all.

Appreciate if someone can tell what the following syntax in a SQl statement is doing and how it actually works!

SuperannuationAmount([SuperID],[SuperInclusive],[Employer%],[SuperableSalary%],[SuperableSalary],[OldSystem],[PrivateSuperAmount],[TotalRemuneration],[AnnualLeaveLoading],[MaximumContribution],[CarAllow],[MaxContribution],[MaximumContribution],IIf(IsNull([MaximumContributionBase]),0,[MaximumContributionBase])) AS FullSuperAmountAnnual

All i can figure out is that the end result is a value, but not how it arrives at that value

same with the following

dblHourlyAmounts([TotalRemuneration],[PayFrequency]) AS FullRemunerationHourly,

I am not an access expert, and have been given a task of reverse engineering business rules for sql statements in access.

Much appreciated for any assistance.

Salwa
 

June7

AWF VIP
Local time
Today, 14:26
Joined
Mar 9, 2014
Messages
5,474
SuperannuationAmount is a VBA custom (user defined) function. That function is doing something with all those field values that are passed to it as arguments. You need to find that function code and see what it is doing.

Same with dblHourlyAmounts.

Open the VBA editor and do a search for those function names.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:26
Joined
Oct 29, 2018
Messages
21,474
Hi. Welcome to AWF!

What's the complete SQL statement? Typically, you would take a business rule and code it. It's a little harder to go the other direction. If you knew the business rule, you can use it to verify the code and check if it's working correctly.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:26
Joined
Feb 28, 2001
Messages
27,189
The statement you presented uses SQL-like syntax but is not a complete SQL statement. It lacks critical elements such as a source table. It is also possible that it lacks other elements such as WHERE or JOIN clauses.

As June7 points out, this code snippet references SuperannuationAmount, which is a foreign function (i.e. not a function native to SQL) that takes fourteen input arguments (one of which is a complex IIF function). We cannot tell you what this does without knowing the source code for the function. It is LIKELY that this is part of a SELECT sequence but even that is uncertain. We cannot answer your question in its current form.
 

Salwa

New member
Local time
Tomorrow, 08:26
Joined
Oct 10, 2023
Messages
12
Thanks all for your prompt responses.

June7 provided the answer. I found the procedure with the relevant information.
 

Users who are viewing this thread

Top Bottom