Hi, novice Access 2007-er, green SQL-er here …
I’ve tried very hard to figure this out by working with advice from similar posts but I am stuck, yet I think I’m almost there…
Table: Proposal Stage_tbl
Fields: ProjectID, PropStageID, ComDate(as well as Topic and a couple other flds not needed for query)
I need to keep track of the number of days that accumulate between records via the ComDate date field.
When I run this qry with the following SLQ behind it, the PrevDate field is empty in every record. I can’t figure out where I’m going wrong. If anyone can point out the problem(s) I would be very grateful.
SELECT [Proposal Stage_tbl].ProjectID,[Proposal Stage_tbl].PropStageID,[Proposal Stage_tbl].ComDate,
SELECT Max(ComDate) as PrevDate
FROM [Proposal Stage_tbl]
WHERE ProjectID = [Proposal Stage_tbl].ProjectID
AND ComDate < [Proposal Stage_tbl].ComDate)
AS PrevDateFROM [Proposal Stage_tbl];
Once I get this qry working then I think I can use it in a new query with a calculation field, with something like [ComDate] – [PrevDate] in it.
Thanks much in advance for your help.
Kathy
I’ve tried very hard to figure this out by working with advice from similar posts but I am stuck, yet I think I’m almost there…
Table: Proposal Stage_tbl
Fields: ProjectID, PropStageID, ComDate(as well as Topic and a couple other flds not needed for query)
I need to keep track of the number of days that accumulate between records via the ComDate date field.
When I run this qry with the following SLQ behind it, the PrevDate field is empty in every record. I can’t figure out where I’m going wrong. If anyone can point out the problem(s) I would be very grateful.
SELECT [Proposal Stage_tbl].ProjectID,[Proposal Stage_tbl].PropStageID,[Proposal Stage_tbl].ComDate,
SELECT Max(ComDate) as PrevDate
FROM [Proposal Stage_tbl]
WHERE ProjectID = [Proposal Stage_tbl].ProjectID
AND ComDate < [Proposal Stage_tbl].ComDate)
AS PrevDateFROM [Proposal Stage_tbl];
Once I get this qry working then I think I can use it in a new query with a calculation field, with something like [ComDate] – [PrevDate] in it.
Thanks much in advance for your help.
Kathy