Steve,
Thanks. What I'm trying to avoid is generating a code and then having to go 
look through all prior codes to make sure it's unique.Not sure if that would 
end up being a processing burden, but I don't want to risk it.

RAD

On Oct 14, 2010, at 10:17 AM, Steve Smith wrote:

> I gave this some thought and decided to share this with you. You may have 
> already considered this and found reasons why this wouldn't work.
>
> Also, a disclaimer: I haven't been doing a lot of Witango development lately 
> so I might get some of the tags wrong.
>
> Create a table that would have fields for discount code, redeemed (y/n), and 
> a foreign key to the order number or customer number.
>
> When you want to create the code, use the <@RANDOM> tag to create it into a 
> variable. Do a search of the discount code table to see if it has been 
> created before (to ensure it is unique) and if it doesn't exist, add it as a 
> new code. If it does exist, use the <@RANDOM> to generate another one and 
> repeat the check uniqueness procedure.
>
> When it is being redeemed, as part of the checkout procedure, write either 
> the order number or customer number to the appropriate field. Better than 
> going through the order history as I am guessing that many records probably 
> won't have discount codes applied to them. Also might give you benefit of 
> knowing who has redeemed which codes and how often. This might help close 
> loops in the system where users misuse discount codes.
>
>
> Steve Smith
>
> Oakbridge Information Solutions
> Oakville Office:         (416) 628-0793
> Cambridge Office:   (519) 489-0142
> Email:  [email protected]
> Web: www.oakbridge.ca
>
> Certified DayLite Master Partner
> Certified DayLite Trainer
> Billings Consultant
> FileMaker Solutions Alliance Member
> MoneyWorks Consultant
> LightSpeed Authorized Reseller
>
> On 2010-10-14, at 11:42 AM, Roland Dumas wrote:
>
>>
>> looking for method to create unique and non-obvious n-digit codes to be used 
>> as discount codes.
>> Should be short enough to use as consumer codes (8 digit?), and probably be 
>> something simply to enter, such as an all caps, and not have an easily 
>> discoverable pattern.
>>
>> I want to generate unique codes and not have to check the history to see if 
>> a code has been used before.
>>
>> Suggestions?
>>
>>
>>
>>
>>
>> ----------------------------------------
>>
>> To unsubscribe from this list, please send an email to [email protected] 
>> with "unsubscribe witango-talk" in the body.
>>
>
>
> To unsubscribe from this list, please send an email to [email protected] 
> with "unsubscribe witango-talk" in the body.



----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe witango-talk" in the body.

Reply via email to