Hello friends,
I have a question on date topic..
How to get a date range for a Week?
Example:
1. User has inputed the Year=2011 and Month=APR in the Options
2. Now I have to show in the report, week wise customer sales in the APR Month of 2011
3. For this I need to know what is the date range of Week1, Week2, Week3... so that I could apply the Week1 date range on the customer ledgers for Week1 sales and soon.
Your suggestions would greatly help in resolving this.
Awaiting on the replies.. Thanks in advance.
Dilip
Falling down is not a defeat..defeat is when you refuse to get up.
0
Answers
Example: this month (may 2011)
you want to have these ranges (american notation)
1. 05/01/11..05/01/11
2. 05/02/11..05/08/11
3. 05/09/11..05/15/11
4. 05/16/11..05/22/11
5. 05/23/11..05/29/11
6. 05/30/11..05/31/11
Correct?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Falling down is not a defeat..defeat is when you refuse to get up.
but indeed, you have to manage the date table (i need some time to think about it, maybe on lunch break, because i'm busy :whistle: )
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
ending date > first of the month & starting date < first of the next month.
You'll get all the weeks you need. A check of the first and last week should be enough to have all the filters one needs.
|To-Increase|
I think we have to play with:
-first day of month/first day of first week
-last day of last week/last day of month
Sog, you meat this, didn't you?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I was just wondering if I could not arrive at exactly the ranges mentioned by Mirko in his example
Falling down is not a defeat..defeat is when you refuse to get up.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Falling down is not a defeat..defeat is when you refuse to get up.
Exactly..
it would be better to insert all week in temp table(date).
is not this right?
Pseudocode filter[1] = 05/01/11..05/01/11
filter[2] = 05/02/11..05/08/11
filter[3] = 05/09/11..05/15/11
filter[4] = 05/16/11..05/22/11
filter[5] = 05/23/11..05/29/11
filter[6] = 05/30/11..05/31/11
btw Belias what do you mean with: Sog you mea(n)t this? I'm much more of a cheesy person
|To-Increase|
...did you try to do these filters on a form based on date? you'll get only 4 lines, so your repeat/until loop will create an array of 4 element max (i know it's pseudo code, but i want to avoid misunderstandings). That's why i said that we have to play around a bit...
P.S.: i prefer meat, anyway, i don't like cheese
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I could now understand what Mirko was saying about "Playing with date" :thumbsup:
Thankyou all guys
Falling down is not a defeat..defeat is when you refuse to get up.
But to be entirely correct it should be <= and >= for the starting/ending date filters
|To-Increase|
i was filtering Starting date 010511..310511
what a fool! ](*,)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
With this piece of code I can get the last week range ?