Author |
Message
|
Boolean |
Posted: Wed Mar 24, 2004 3:44 am Post subject: What week is it? |
|
|
Acolyte
Joined: 05 Jun 2003 Posts: 56 Location: Sweden
|
Does some one know if it's possible to get the week number from a date in WBI MB?
I.e. Given a date, I want to extract the week number of the year. _________________ / Boolean |
|
Back to top |
|
 |
wooda |
Posted: Tue Mar 30, 2004 5:02 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
It's not possible using ESQL functions.
However the MRM datetime handling can write out or parse a datefield in a format that includes week numbers. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Mar 30, 2004 5:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
wooda wrote: |
It's not possible using ESQL functions.
However the MRM datetime handling can write out or parse a datefield in a format that includes week numbers. |
I think you mean that there is no predefined ESQL function for calculating the week number.
It should be relatively simple to write a custom ESQL function that will calculate the week number. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wooda |
Posted: Tue Mar 30, 2004 6:28 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Indeed that is exactly what I meant.
Thankyou for your excellent clarification.
 |
|
Back to top |
|
 |
Boolean |
Posted: Tue Mar 30, 2004 10:41 pm Post subject: |
|
|
Acolyte
Joined: 05 Jun 2003 Posts: 56 Location: Sweden
|
We have written a plugin for this purpose, but it should be much more handy to deal with this the ESQL way.
I'm not that familiar with the date functions though and am a little uneasy if I can get this bullet proof or not. Are there anyone out there, that can give me a hint? _________________ / Boolean |
|
Back to top |
|
 |
scaryjase |
Posted: Wed Mar 31, 2004 6:55 am Post subject: |
|
|
Novice
Joined: 17 Jul 2003 Posts: 22
|
it all depends upon what you mean by "week number" really. Do you mean
((the number of days since Jan 1st) DIV 7) + 1
or do you mean
(the number of Sundays since Jan 1st) + 1
one is easier than the other... _________________ scary |
|
Back to top |
|
 |
scaryjase |
Posted: Wed Mar 31, 2004 7:10 am Post subject: |
|
|
Novice
Joined: 17 Jul 2003 Posts: 22
|
|
Back to top |
|
 |
|