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?ThanksAlanDonovan 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:
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?ThanksAlanDonovan 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:
Date problems-more (1997)
FEW QUESTIONS (1997)
WebDNA SpeedTest Update (2006)
Not reading code (1997)
delete a file? (1998)
Commas in search (1998)
Rhapsody? (1997)
Database search in JavaScript with passed values (2002)
WebCatalog 2.0 b 15 mac (1997)
Extended [ConvertChars] (1997)
[SMSI]Price and Formula.db (2002)
different show next (1997)
Review comparison by PC Magazine: Open for On-line Business (1997)
Searching multiple Databases (1997)
WebTen and WebCat (1997)
Simple way to create unique SKU (1997)
Separate SSL Server (1997)
Sort Order on a page search (1997)
Limiting user access to .tmpl files (1997)
Running webcat 6 on Windows XP Prof. (2005)