Add a new filed to a query (1 Viewer)

Joy83

Member
Local time
Today, 03:24
Joined
Jan 9, 2020
Messages
116
Hi,
I am really learning a lot from this amazing forum
i have a query that is working perfectly
One of the fields is date
is it possible to add one more filed to this query to calculate the date difference between that date and today (by month)

i just want to add one more column to the data-sheet view of that query
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:24
Joined
Oct 29, 2018
Messages
21,357
Why not? Is it a Totals query? Try using the DateDiff() function. For example:

NoOfMos: DateDiff("m", [DateFieldName], Date())
 

Joy83

Member
Local time
Today, 03:24
Joined
Jan 9, 2020
Messages
116
Why not? Is it a Totals query? Try using the DateDiff() function. For example:

NoOfMos: DateDiff("m", [DateFieldName], Date())

this is helpful
It worked
Thanks a lot
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:24
Joined
May 7, 2009
Messages
19,169
note that DateDiff() will not accurately compute the month difference.
take for instance march 31, 2022 against today's date (Date()).
it will return 1 when in fact it is less than 1 month.
 

Users who are viewing this thread

Top Bottom