Re: Date in IF ELSE Comparison

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59946
interpreted = N
texte = lmao... you are right when you say that you cant read that in my description although what you are saying would certainly make sense ;-) I guess the aim of what I am trying to acheive would be to have seasonal sales where offer expires 24/12/2004 for christmas purchases or 01/02/2004 for a january sale (as an example). Is this possible using the method you suggest? Thanks Alan Donovan Brooke wrote: > 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 > > ------------------------------------------------------------- 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)
lmao... you are right when you say that you cant read that in my description although what you are saying would certainly make sense ;-) I guess the aim of what I am trying to acheive would be to have seasonal sales where offer expires 24/12/2004 for christmas purchases or 01/02/2004 for a january sale (as an example). Is this possible using the method you suggest? Thanks Alan Donovan Brooke wrote: > 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 > > ------------------------------------------------------------- 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:

webdna page not found redirect (2007) [WebDNA] Problem with Cookies in IE and Safari (2009) Major bug report on rootbeer (1997) triggers (2002) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) delete a file? (1998) Working with framesets (1998) FEATURE REQUEST: Auto Resizing of images (2002) Country & Ship-to address & other fields ? (1997) problem with dates, NT version (1997) Documentation Feedback (1997) Cookies (1999) searching multiple databases in single search (1997) Root Folder problems cont. (1998) Best way to add data to .db (1999) LookUp Tag (1997) WebCatalog for guestbook ? (1997) AE aware WebCatalog.acgi? (1997) Verify entry into a text field (2005) Multiple prices per product (2004)