Mystery parameter

R

rsosabusiness

Hi, everyone!
A query designed to group pay records by quarter for purposes of
filing tax returns ends with the following statement:
GROUP BY EmployeeID, Format$(PayRecords.PayDate,'q yyyy'),
Year(PayRecords.PayDate)*4+DatePart('q',PayRecords.PayDate)-1;
I can understand the first two parameters but the last one (Year ...)
has me totally baffled. What does it do?
Cordially,
Robert
 
B

BruceM

If you open the immediate window (Ctrl + G) and enter:
?Year(Date)*4+DatePart('q',Date)-1
(substituting the current date for the field) you get the answer 8028. That
part of the formula takes the year (2007), multiplies by 4 (result: 8028),
adds the Quarter (1 as of this date) and subtracts 1, leaving 8028. I can't
guess the reason for using that expression.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top