hpng98
15th April 2004, 09:22
Hi.
I create a session to display the report.
My search key is : from date
: to date

And I want to make sure tht the user only allowed to view the record within the same
month. Which meant my year and month for from date & to date must be same.
Is there any command to chk?? how?

If I want to chk the above after the user press the "Continue" button, How to write??
Thanks alot.

cucucucu
15th April 2004, 09:54
frdt |From Date
todt|To Date
choice.cont.process:
on.choice:
temp1 = num.to.date$(frdt,2)
year1 = temp(5;4)
day1 = temp(3;2)
month1= temp(1;2)
temp2 = num.to.date$(todt,2)
year2 = temp(5;4)
day2 = temp(3;2)
month2= temp(1;2)

You can compare year1 & year2, month1 & month2

en@frrom
15th April 2004, 11:18
Alternatively use num.to.date(date.f, year.f, month.f, day.f), where date.f is the input, and the other fields are output, and the same for the to-date, and compare.

This is for a date format. If it is utc, you should use the function utc.to.date, as follows:
utc.to.date(date.f, year.f, month.f, day.f, hour.f, minute.f, sec.f)
where date.f is the input, and the other fields are the output.

For both functions all the ref-variables should be declared as long.

Good luck!!


En.