How to use another table fields as a criteria for MS Access

后端 未结 2 2094
梦谈多话
梦谈多话 2021-01-22 14:03

This is the MS Access related query.

I have a table with three columns: FName, FValue and VDate in MS Access.(The actual table is quite big bu

2条回答
  •  自闭症患者
    2021-01-22 14:28

    Make a new tables "quarters" with fields for Yr, Qtr, Start and End. Start and End are date/time fields:

    Quarters
    Yr      Qtr Start       End
    
    2014    1   1/1/2014    3/31/2014
    2014    2   4/1/2014    6/30/2014
    2014    3   7/1/2014    10/31/2014
    

    Then use this query:

    SELECT Quarters.Yr, Quarters.Qtr, Table.FName, Min(Table.FValue) AS FValue
    FROM [Table], Quarters
    WHERE (((Table.CDate)>=[start] And (Table.CDate)<=[end]))
    GROUP BY Quarters.Yr, Quarters.Qtr, Table.FName;
    

    Note - there is no join between the two tables in the query.

提交回复
热议问题