display date using format ?
i want to display date in a text box which is in a flex grid
Code:
Estval = bookval.EstimatedLife 'here value in Estval = 700
Estval = Estval / 100 'here value in Estval = 7
MainBookFlexGrid(1).col = col
MainBookFlexGrid(1).Row = 5
MainBookFlexGrid(1).Text = Format(Estval, "00 yrs 00 mos") 'here it becomes 00 yrs 07 mos
MainBookFlexGrid(1).Text = Format(Estval, "00 yrs 00 mos")--->this displays 00 yrs 07 mos instead of 07 yrs 00 mos
where am i going wrong?
plz help..
Re: display date using format ?
Seems like the format you are using basically splits the value such that the "mos" get the two right-most digits, and the "yrs" get everything to the left of that. So a value of 100 yields 01 yrs and 00 mos. A value of 700 would therefore give you "07 yrs 00 mos".
Re: display date using format ?
Your format construction is wrong.
You have to know what the unit of Estval is in order to write a proper format instruction.
What does the 700 signify? Days? Months?