kvilimas
asked on
how to extract trimester out of date field
There are standard functions to get year, quarter, month, etc out of date field ( DATEPART functions). In Norway though we use often trimesters (i.e. 4 month periodes, 3 in one year). Does anyone have an idea/function to extract that out of date?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi senthurpandian. Is there something missing in your function? Truncation or something?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would suggest to accept #30589065 as a solution,
I would suggest that your solution is only effective as long as one remembers the formula: (MONTH(MyDateField )-1) / 4) + 1. I contend that putting the logic into a user-defined function is more extensible.
((MONTH(MyDateField)-1) / 4) + 1
in your query.
Regards.