G
Guest
Hi everyone,
I have a sql table that has 5 column as:
cl1Month - cl1_3Month - cl3_6Month - cl6_12Month - clMoreThan12Month
Now I have to date and I have to find the differences and check as month and
put into one of the above column.
If the diiferences is 0 or 30 days than value should be store in cl1Month.
Example:
If I run the program today (24th July 2006) I have to find due Date from DB.
And that say the due date is: 9th September 2006.
Then I have to get end of last month date from DB as 31 June 2006. This is
done and the date store in DB every end of the month from another program.
Now I use:
dtDiff = DateDiff(DateInterval.Day, cdLastMonth, cdDueDate)
and I find 82 day.
I want to convert this integer (82) (if possible) into month.
And then I will asgin the myDecimal value in the right column.
As wecan see 82 days is nearly 2 months 20 day. But not exactly.
Becasue some month have 30 days and Feb has 28 or 29.
I want to consider all this and find a solution but unfortunatly I am not
able to achive it.
If finding day is 31 and I will have to count from last month date to see if
it is in 1 month range.
And if it is the MyDecimal value have to goto in cl1Month column.
Does anyone there to help me out.
I thank you for your kind understanding for reading my post.
Thank you.
Rgds,
GC
I have a sql table that has 5 column as:
cl1Month - cl1_3Month - cl3_6Month - cl6_12Month - clMoreThan12Month
Now I have to date and I have to find the differences and check as month and
put into one of the above column.
If the diiferences is 0 or 30 days than value should be store in cl1Month.
Example:
If I run the program today (24th July 2006) I have to find due Date from DB.
And that say the due date is: 9th September 2006.
Then I have to get end of last month date from DB as 31 June 2006. This is
done and the date store in DB every end of the month from another program.
Now I use:
dtDiff = DateDiff(DateInterval.Day, cdLastMonth, cdDueDate)
and I find 82 day.
I want to convert this integer (82) (if possible) into month.
And then I will asgin the myDecimal value in the right column.
As wecan see 82 days is nearly 2 months 20 day. But not exactly.
Becasue some month have 30 days and Feb has 28 or 29.
I want to consider all this and find a solution but unfortunatly I am not
able to achive it.
If finding day is 31 and I will have to count from last month date to see if
it is in 1 month range.
And if it is the MyDecimal value have to goto in cl1Month column.
Does anyone there to help me out.
I thank you for your kind understanding for reading my post.
Thank you.
Rgds,
GC