I am having great difficulty in ordering dates in the correct order. I have created the following formulae to string together the numberical month and year, e.g. 12/2002 (December 2002) and 01/2003 (January 2003). I keep getting January before December as 01 comes before 12.
dim a as number, b as string
If isdate(toText({SOP_Order_Line.Date_Required})) then
a = datepart("m",{SOP_Order_Line.Date_Required})
If a > 0 and a < 13 then
formula = monthname(a)
else
formula = "Unknown"
end if
else
formula = "Unknown"
end if
and for the year;
formula = datepart("yyyy",{SOP_Order_Line.Date_Required})
formula = Year ({SOP_Order_Line.Date_Required})
Please help, it is driving me mad!
Thanks a lot.
dim a as number, b as string
If isdate(toText({SOP_Order_Line.Date_Required})) then
a = datepart("m",{SOP_Order_Line.Date_Required})
If a > 0 and a < 13 then
formula = monthname(a)
else
formula = "Unknown"
end if
else
formula = "Unknown"
end if
and for the year;
formula = datepart("yyyy",{SOP_Order_Line.Date_Required})
formula = Year ({SOP_Order_Line.Date_Required})
Please help, it is driving me mad!
Thanks a lot.