How to create a time series in Access and can use it in a query

前端 未结 1 766
我寻月下人不归
我寻月下人不归 2021-01-15 19:28

The facts:

I use Access 2013, but it must be run in Access 2007 aswell.

I have the following 3 tables:

Order:

Id             


        
相关标签:
1条回答
  • 2021-01-15 19:49

    Yes. Create a query like this:

    SELECT DISTINCT 
        [Tens]+[Ones] AS Factor, 
        10*Abs([Deca].[id] Mod 10) AS Tens, 
        Abs([Uno].[id] Mod 10) AS Ones
    FROM 
        msysobjects AS Uno, 
        msysobjects AS Deca;
    

    Save it as qdyFactor. Then create this query:

    SELECT DISTINCT 
        DateAdd("d",[Factor],[DateFrom]) AS Dates
    FROM 
        qdyFactor
    WHERE 
        qdyFactor.Factor Between 0 And DateDiff("d",[DateFrom],[DateTo]);
    

    This will create the list of dates. Finally, use this to filter and sum from your other tables.

    0 讨论(0)
提交回复
热议问题