I need to use a dateadd funtion based on values in a table.
E.G 1,2,3,4,5,6,= add 2 years 7,8,9,10,11,12,13,14 ,15 or 19 = ad 3 years 16,17,18 = add 5 years. These are added to an entered date.
I see that to add a date is =DateAdd("y", 2,[txtdate]) but I am looking for a multiple choice function.
3 1796
I need to use a dateadd funtion based on values in a table.
E.G 1,2,3,4,5,6,= add 2 years 7,8,9,10,11,12,13,14 ,15 or 19 = ad 3 years 16,17,18 = add 5 years. These are added to an entered date.
I see that to add a date is =DateAdd("y", 2,[txtdate]) but I am looking for a multiple choice function.
You don't say the name of your field that holds these values or if it is available on your form. Assuming it is on the form and is called txtValue then ... - =DateAdd("y", [txtValue], [txtdate])
Mary
I would suggest using an "If/Then/Else" or a "Select Case" ie.: - If [tbl_value] is < 7 Then [MyDate] = DateAdd("yyyy",2,[OriginalDate])
.
It might be more elegant to declare your interval as a string and use the IF or Select Case to set the value. - DateAdd("yyyy",MyString,[OriginalDate])
.
I hope I'm not being to vague. It's 0530 at the tail end of a night shift for me.
Good Luck
Hope it's of some help.
NeoPa 32,556
Expert Mod 16PB
I need to use a dateadd funtion based on values in a table.
E.G 1,2,3,4,5,6,= add 2 years 7,8,9,10,11,12,13,14 ,15 or 19 = ad 3 years 16,17,18 = add 5 years. These are added to an entered date.
I see that to add a date is =DateAdd("y", 2,[txtdate]) but I am looking for a multiple choice function.
You could use Choose() : - =DateAdd("y",Choose([DJSValue],2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,5,5,5,3),[txtDate])
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bob |
last post by:
Currently I am using this statement to translate 3 fields in my db
thru Visual Basic. I import the data from one table to another then
call the IFF statements and the NewDate to translate the...
|
by: bhbgroup |
last post by:
I have a query on one large table. I only add one condition, i.e. a
date (the SQL reads like 'where date > parameterdate'.
This query is rather quick if 'parameterdate' is either explicitly...
|
by: Crimsonwingz |
last post by:
Need to calculate a sum based on a number of factors over a period of
years. I can use formula ^x for some of it, but need totals to carry
over in the sum and have only been able to do this thus...
|
by: asreryll |
last post by:
I wish to show a future date in a table, so that I can sort and know
which case is in need of a review. I can display a future date in a
form but I want to see all records that are due on a certain...
|
by: m_t_hill |
last post by:
Running MS Access 2000
MS Windows XP Pro
This has caused me a lot of hair loss in the last few days so would
appreciate any help.
I am running code to append/update a local access database...
|
by: audiophilechris |
last post by:
Can anyway help me write this query? I've created a DB to help me
manage delivery logistics for items I rent out. I have a table that i
use to record delivery date, delivery time, pickup date,...
|
by: keri |
last post by:
Hello again,
While I try and solve the calender issue I also have another problem.
I have a form & table (appointments) where the user records
appointments in the future. The fields include...
|
by: CoolFactor |
last post by:
MY CODE IS NEAR THE BOTTOM
I want to export this Access query into Excel using a command button on an Access form in the following way I describe below.
Below you will find the simple query I am...
|
by: Harlequin |
last post by:
I must start this posing by making the point that I am NOT a VB programmer and I'm something of a Newbie to MS Access. I can program in a number of languages (Java, Javascript, PERL,PHP and TCL) but...
|
by: drrajnishpatel via AccessMonster.com |
last post by:
Dear Friends i am trying to get a future date as follows,
data:1) date of proceeding to leave = D
2) number of days leave sanctioned =N
3) date of reporting for duty =R
i grant "n" number of...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |