SpindleMania
Registered User.
- Local time
- Today, 01:51
- Joined
- Aug 4, 2006
- Messages
- 13
Hi All,
i have a slight problem i have a access table which has the following fields:
Name
Photocard ID
Purchase Date
Photo
Cashsaver Zone
Valid From
Period of Validation
Expiry
the period of validation field has a lookup to another table with the folwing values: 28 Days, 3 Months, 6 Months and Annual.
the valid from date is entered manually.
basically (maybe not uite the right word!) i need the the expiry field to automatically insert the correct expiry date by looking in the valid from date and adding the correct amount of time onto it according to what is selected in the period of validation field.
example:
Valid from date is 01/01/2006
Period of validation is 6 Months
Expiry date should be 01/06/2006 (01/01/2006 + 6 Months)
i came up with the following formula although i know its not really correct and some of the words arent functions at all just to show what is should be based on:
WHERE Period of validation <= DataValue ("28 Days") then DateAdd("d",28, Period of validation)
WHERE Period of validation <= DataValue ("3 Months") then DateAdd("m",3, Period of validation)
WHERE Period of validation <= DataValue ("6 Months") then DateAdd("m",6, Period of validation)
WHERE Period of validation <= DataValue ("Annual") then DateAdd("m",12, Period of validation)
also i am unsure into what box to type this into?
i would greatly apperciate some help
Spindlemania
i have a slight problem i have a access table which has the following fields:
Name
Photocard ID
Purchase Date
Photo
Cashsaver Zone
Valid From
Period of Validation
Expiry
the period of validation field has a lookup to another table with the folwing values: 28 Days, 3 Months, 6 Months and Annual.
the valid from date is entered manually.
basically (maybe not uite the right word!) i need the the expiry field to automatically insert the correct expiry date by looking in the valid from date and adding the correct amount of time onto it according to what is selected in the period of validation field.
example:
Valid from date is 01/01/2006
Period of validation is 6 Months
Expiry date should be 01/06/2006 (01/01/2006 + 6 Months)
i came up with the following formula although i know its not really correct and some of the words arent functions at all just to show what is should be based on:
WHERE Period of validation <= DataValue ("28 Days") then DateAdd("d",28, Period of validation)
WHERE Period of validation <= DataValue ("3 Months") then DateAdd("m",3, Period of validation)
WHERE Period of validation <= DataValue ("6 Months") then DateAdd("m",6, Period of validation)
WHERE Period of validation <= DataValue ("Annual") then DateAdd("m",12, Period of validation)
also i am unsure into what box to type this into?
i would greatly apperciate some help
Spindlemania