Re: Date in IF ELSE Comparison

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59945
interpreted = N
texte = Alan, when using an epoch as a date, the value becomes a number. What are you comparing then for your expired voucher? Are you setting the current date when the voucher is initiated, and is the voucher good for an amount of days? If so then you would just get the days since epoch for todays date and compare it to the the number value stored by subtracting it from todays math date. If the result of that comparison is greater than the amount of days the voucher is suppose to be active, then the voucher becomes in-active. However, the above assumes some things that I couldn't read in your description. Donovan Alan White wrote: > Hey folks > > I 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. > > Regards > Alan -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <- Graphic Design, Custom Tags and Labels -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- 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:

    
  1. Re: Date in IF ELSE Comparison ( Alan White 2004)
  2. Re: Date in IF ELSE Comparison ( Donovan Brooke 2004)
  3. Re: Date in IF ELSE Comparison ( Alan White 2004)
  4. Re: Date in IF ELSE Comparison ( Donovan Brooke 2004)
  5. Re: Date in IF ELSE Comparison ( "Erol Guneri" 2004)
  6. Re: Date in IF ELSE Comparison ( "Erol Guneri" 2004)
  7. Re: Date in IF ELSE Comparison ( Alan White 2004)
  8. Re: Date in IF ELSE Comparison ( "WebDna @ Inkblot Media" 2004)
  9. Re: Date in IF ELSE Comparison ( Alan White 2004)
  10. Re: Date in IF ELSE Comparison ( Donovan Brooke 2004)
  11. Re: Date in IF ELSE Comparison ( Alan White 2004)
  12. Re: Date in IF ELSE Comparison ( Donovan Brooke 2004)
  13. Date in IF ELSE Comparison ( Alan White 2004)
Alan, when using an epoch as a date, the value becomes a number. What are you comparing then for your expired voucher? Are you setting the current date when the voucher is initiated, and is the voucher good for an amount of days? If so then you would just get the days since epoch for todays date and compare it to the the number value stored by subtracting it from todays math date. If the result of that comparison is greater than the amount of days the voucher is suppose to be active, then the voucher becomes in-active. However, the above assumes some things that I couldn't read in your description. Donovan Alan White wrote: > Hey folks > > I 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. > > Regards > Alan -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <- Graphic Design, Custom Tags and Labels -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- 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/ Donovan Brooke

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:

Error 11 (1996) Happy Halloween - Check out the pumpkin (2002) RE: Forcing Paragraph Breaks on Results - Yes you can replace String for String! (1998) calender with business days (1998) duplicating cart items (1998) [WebDNA] I need a newbie installation primer (2011) Press Release hit the NewsWire!!! (1997) DRC (2004) syntax question, not in online refernce (1997) webcat database helper question (2000) [TaxableTotal] - not working with AOL and IE (1997) WebCatalog sales (1997) Re[2]: 2nd WebCatalog2 Feature Request (1996) [OT] Apple Auto Index (2001) Physical Security for WebCatalog Directories (1997) New Plug-in and Type 11 errors (1997) Summing fields (1997) CMS - Formatting Content (2004) quitting (1997) select multiple 2 more cents (1997)