If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date difference
May I know how to do a date different between a given date in a field and
today's date. I want to add a field on aging and calculate the date difference in query. For example : Aging = diff( transaction date, today date) Thanks -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Date difference
hi Emily,
EMILYTAN via AccessMonster.com wrote: May I know how to do a date different between a given date in a field and today's date. If your result should be a date: = CDate(dtToday - dtTransaction) otherwise take a look at DateDiff() in the online help. mfG -- stefan -- |
#3
|
|||
|
|||
Date difference
I mean in a query table?
What should I add in? Stefan Hoffmann wrote: hi Emily, May I know how to do a date different between a given date in a field and today's date. If your result should be a date: = CDate(dtToday - dtTransaction) otherwise take a look at DateDiff() in the online help. mfG -- stefan -- -- Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
Date difference
On Jul 31, 9:53 am, Stefan Hoffmann
wrote: May I know how to do a date different between a given date in a field and today's date. If your result should be a date: = CDate(dtToday - dtTransaction) That doesn't sound correct e.g. SELECT CDate(DATE() - #2007-07-23 00:00:00#) AS result_datetime returns a DATETIME value sometime around the turn of the last century : ( otherwise take a look at DateDiff() in the online help. Yes, I think the OP would want something more like: SELECT DATEDIFF('D', #2007-07-23 00:00:00#, DATE()) AS result_days Jamie. -- |
#5
|
|||
|
|||
Date difference
hi Jamie,
Jamie Collins wrote: If your result should be a date: = CDate(dtToday - dtTransaction) That doesn't sound correct e.g. SELECT CDate(DATE() - #2007-07-23 00:00:00#) AS result_datetime returns a DATETIME value sometime around the turn of the last century Which is exactly the date span between the two dates based on the default start date of the date type. But I have to admit, that this is maybe not what she wanted. mfG -- stefan -- |
Thread Tools | |
Display Modes | |
|
|