any idea how to compare two date. because i want make mulitple i condition to solve my problem
here what i want to do:
list data on asp page with multiple condition for displaying day late:
Condition:
1. Check if delivery date(store as sting in table) -> Isdate True or False
2. If True then check delivery status.false then exit
3. if delivery status = 0 then check delivery date > current date else exit
4. if delivery date > current date then exit else count day late
right now i can't compare for condition no.3 (cause if i not compare this then the result will count day late before and after promised date) . which i expected only day late return after promised date only.
here my code:
ord_PromisedDate = rstOrders("ord_PromisedDate")
stat_deli = cint(rstOrders("stat_deli"))
stat_prodates = IsDate(ord_PromisedDate)
convert_prodate = fncfmtdate(rstOrders("ord_PromisedDate"),"%d/%M/%Y")
NOWDATE= fncfmtdate(Date,"%d/%M/%Y")
if stat_deli = 0 then
curr_stat = "No Delivery"
else if stat_deli = 1 then
curr_stat = "Complete Delivery"
else if stat_deli = 2 then
curr_stat = "Partial Delivery"
end if
end if
end if
if stat_prodates = true AND stat_deli = 0 then
day_late = DateDiff ("d",convert_prodate,NOWDATE)
else if stat_prodates = False then
day_late = ""
end if
end if
ANY HELP OR SOLUTION REALLY APPRECIATED.
thank you.