date comparison

Here should go questions about transforming XML with XSLT and FOP.
cool_123
Posts: 3
Joined: Tue Oct 30, 2007 12:39 pm
Location: India

date comparison

Post by cool_123 »

i have to compare a date and then after comparing the date i have to check that under which quarter the date comes.i tried it but not able to find a solution.
can anybody suggest me something how to work out with this.
jkmyoung
Posts: 89
Joined: Mon Mar 06, 2006 10:13 pm

Post by jkmyoung »

What format is your date in? How are you dividing the quarters?

Could you post your current code?
It's easier to adjust existing code than give you code that may or may not work with your current situation.
cool_123
Posts: 3
Joined: Tue Oct 30, 2007 12:39 pm
Location: India

Post by cool_123 »

actually the date fomat was Sep 10,2007 but i changed it to mm/dd/yyyy to make it more easy for performing the calculations.

i m giving a range of dates the start date to the end date now i have to check the end date that to which month it belogs and what is the date and then ihave to set the value for tat particular quater.
Quarters will be:
1st Quarter:Jan - Mar
2nd quarter:Apr - june
3rd quarter: july-sep
4th quarter:oct- dec
one more thing is there if the end date is like 20/03/2007 then it has to fall in next quarter that is in 2nd quarter.

i was using the if condition and then using the substring functio to check the value of month.if the value of month is less than 3 then it must fall within 1 st quarter and so on.
but it didnt worked out.

Plz do provide some suggestions

thanx
Post Reply