|
Re: sql stmt precedence of functions and how they are evaluated. [message #6434 is a reply to message #6433] |
Wed, 16 April 2003 15:25 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
There's no real operator precedence issue here because the only operators involved are + and -, and they share the same level of precedence. Other than that, any expressions will be resolved before being included in the date/math calculations.
As written, it:
1) Takes midnight today (4/16)
2) Adds 7 days = 4/23
3) Subtracts the number of days equal to the day of week that is a week from today (a week from today is Wednesday, 4/23, and Wednesday is day 4 of the week - so we subtract 4 days = 4/19
4) Adds 3 days = 4/22
5) Convert the date to a character string.
By the way, the addition of 7 in step 3 is superfluous. A week from today will be the same day of week that today is.
Does this help?
|
|
|
|