obembe said:
The expression DatePart("q",[OrderDate],1,0) will return a positive
Integer value from 1 to 4, depending on the date.
Hello Chris,
What I don't understand here are the last two parts of the argument, i.e.
the "1,0". I tried leaving them out but got the same result. What are the
permissible ranges of those two digits at the end? I even changed them to
something weird like 2014,137 and still got the same result.
Those values are for firstdayofweek and firstweekofyear respectively.
Valid values for firstdayofweek are 0 through 7, where 0 means use the NLS
API setting, and 1 through 7 correspond to Sunday through Saturday (with 1,
or Sunday, being the default)
Valid values for firstweekofyear are 0 through 4, where 0 means use the NLS
API setting, 1 (the default) means "Start with week in which January 1
occurs", 2 means "Start with the first week that has at least four days in
the new year." and 3 means "Start with first full week of the year".
These normally matter more when calculating week number, but I suppose it
could make a difference when a particular quarter ends and begins.