By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,560 Members | 1,093 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,560 IT Pros & Developers. It's quick & easy.

Add a column value to date(which is an expression)

didajosh
P: 47
Hi,
In the process of adding date:
DateAdd("m",[LockupTermMonths1],[ComittedDate])

LockupTermMonths1 - is a value that is coming from a table for the corresponding row.

ComittedDate - This is an expression that is being calculated (using If Then condition) when the query runs.

How will this be done?

Please help...... :(

Dipali
Aug 6 '08 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,602
Dipali,

There's no actual questioon here. What do you want to know?
Aug 6 '08 #2

didajosh
P: 47
Oops...I will try again,

In the process of adding date:
DateAdd("m",[LockupTermMonths1],[ComittedDate])


Here LockupTermMonths1 and ComittedDate , are not fixed values, the table is like
Table1 is:
Fund::::::::::::LockupTermMonths1
AO::::::::::::::::::::: 36
AP::::::::::::::::::::: 36
EW:::::::::::::::::::::12


Table2 is:
Fund::::::::::::::::ComittedDate
AO:::::::::::::::::::::1/1/2001
AO:::::::::::::::::::::1/1/2002
AO:::::::::::::::::::::1/1/2003
AO:::::::::::::::::::::1/1/2006
AO:::::::::::::::::::::7/1/2006
AP:::::::::::::::::::::1/1/2001
AP:::::::::::::::::::::1/1/2002
AP:::::::::::::::::::::7/1/2005
AP:::::::::::::::::::::10/1/2007
EW:::::::::::::::::::::12/31/2002
EW:::::::::::::::::::::1/31/2003
EW:::::::::::::::::::::2/29/2004
EW:::::::::::::::::::::4/30/2004

Now I want a resulting table as :

Fund::::::::ComittedDate::::::: LockupTermMonths1(IN TERMS OFDATE)

How will this be done?

Please help...... :(

Regards,
Dipali
Aug 7 '08 #3

NeoPa
Expert Mod 15k+
P: 31,602
Aah, now it starts to become clearer.

I'll assume that you need the data displayed in a query for now (as you haven't provided any details of any new table to put the data into).

Firstly we need to create a basic query that links the two tables on the key - [Fund]
Expand|Select|Wrap|Line Numbers
  1. SELECT T2.Fund,
  2.        T2.CommittedDate,
  3.        ...
  4. FROM Table2 AS T2 INNER JOIN Table1 AS T1
  5.   ON T2.Fund=T1.Fund
With that done, we need to look at what's required to display the date value you require (replacing the unspecified line #3).
Expand|Select|Wrap|Line Numbers
  1. DateAdd('m',T1.LockupTermMonths1,T2.CommittedDate) AS ReleaseDate
NB. I've changed the spelling of your field ComittedDate as you will see. I strongly recommend you do this in your live database too (including all references to it). Anyone working on this will automatically understand what it means, but are likely to spell it the correct way without thinking.
Aug 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.