Date in IF ELSE Comparison
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 59944
interpreted = N
texte = Hey folksI know this has probably been asked countless times but I figured I would fire with problem specific.I have the following code in a template:-[if "[checkCode]"="[code]"] [then][setheader cart=[cart]]header40=T_[boosterID][/setheader][/then] [else][text show=f]msgError=T_invalid[/text][/else][/if]I have the voucher working perfectly but I now have had to add Expiry checking in the form of :-[if "[checkCode]"="[code]"] [then] [if [date format=%d/%m/%Y]>[expiryDate]] [then][text show=f]msgError=T_expired[/text][/then] [else][setheader cart=[cart]]header40=T_[boosterID][/setheader][/else] [/if] [/then] [else][text show=f]msgError=T_invalid[/text][/else][/if]I have a vouchers database that contains a field called expiryDate but am unsure of how to work the storing of date in the form of[math]{[inputted date field]}[/math] (if that is the best way) and how to do the comparison in the if statement. Our server is configured to read dd/mm/yyyy date format (UK) if that has any impact on the solution.Hope someone can help.RegardsAlan-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Hey folksI know this has probably been asked countless times but I figured I would fire with problem specific.I have the following code in a template:-[if "[checkCode]"="[code]"] [then][setheader cart=[cart]]header40=T_[boosterID][/setheader][/then] [else][text show=f]msgError=T_invalid[/text][/else][/if]I have the voucher working perfectly but I now have had to add Expiry checking in the form of :-[if "[checkCode]"="[code]"] [then] [if [date format=%d/%m/%Y]>[expiryDate]] [then][text show=f]msgError=T_expired[/text][/then] [else][setheader cart=[cart]]header40=T_[boosterID][/setheader][/else] [/if] [/then] [else][text show=f]msgError=T_invalid[/text][/else][/if]I have a vouchers database that contains a field called expiryDate but am unsure of how to work the storing of date in the form of[math]{[inputted date field]}[/math] (if that is the best way) and how to do the comparison in the if statement. Our server is configured to read dd/mm/yyyy date format (UK) if that has any impact on the solution.Hope someone can help.RegardsAlan-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Alan White
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
OT: javascript help (2003)
MATH PROBLEM (1997)
[OT] XServe networking PITA (2004)
Major bug report on rootbeer (1997)
More than one db with the same namn (was: WC2f3) (1997)
Submit buttons not working.... (1999)
WC Database Format (1997)
RE: ShowNext Command (1997)
shocart strange behavior - ANSWER (1999)
OT: Limit on # of Pulldown entries (1997)
[FoundItems] solved - thanks (1997)
Thanks Grant (1997)
test (2000)
[WebDNA] No more SQL in 7.1? (2012)
PCS Frames (1997)
b18 problem on NT 4.0 (1997)
Error Lob.db records error message not name (1997)
PERL to Web DNA (2000)
Error, 101 a DNS problem ? (1997)
Missing CR in message (2005)