Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUBTRACT PREVIOUS DATE FIELD FROM CURRENT DATE FIELD

Status
Not open for further replies.

Kim296

MIS
Aug 24, 2012
98
US
Good Afternoon Everyone,

I'm using a query with a lot of calculated fields. The stumper for me is how to calculate a date difference between the current record date and the previous record date within the same record set.

query name: qryProjectionEventsAll
record set: PROJID (Linked to Main Event)
field name: d (date value)

Any help is greatly appreciate.
Kim
 
Some small sample of your data would go a long way. And the sample of expected result based on it as well. Like - what you want in the first record which does not have "previous record date", right?


---- Andy

There is a great need for a sarcasm font.
 
Two main tables used:
tblProjectMain - automatic sys id number (PROJID), this data is the same for each crime series (one project)
tblProjectEvent - there are multiple events in each Project Series (linked to main project by sys id PROJID)

Each Project may have many events in the series (record set). The Date (field "d" in the query) contains an average date value of [ls] & [af]. What I'm trying to accomplish is show the first record in each record set as null, then subtract the 2nd date value from the 1st, then subtract the 3rd date value from the 2nd, etc.. through the entire record set, then start over with a new record set.

This one step is so confusing to me. I've figured out all other fields except this one.

Any help is appreciated. Please see the screen shot of my form. The main form and subform are both run via different queries (qryProjectMain) & (qryProjectEvents)

form_rziedw.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top