报告根据用户输入进行更改

编程入门 行业动态 更新时间:2024-10-11 09:24:50
本文介绍了报告根据用户输入进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好, 我有一个产品列表,其中包含两个属性(字段):LEVEL和VARIANT。每个物业有7种可能性: 等级可以是: 等级1 等级2 等级3。 .. Lavel7 和VARIANT: V1 V2 V3 ... V7 我创建的报告显示属于每种可能情况的产品: ie。属于LEVEL1和V1的产品,属于LEVEL2和V1的产品....这样我根据49个不同的查询创建了49个不同的报告。 我想知道是否有一种只创建一个查询和一个报告的方法,它将询问用户所需属性的组合(哪个级别和哪个变量),以便报告显示这些产品。 主要问题是避免必须以非常简单的差异创建每个不同的查询和报告。 谢谢, Gilberto

Hello, I have a list of products with two properties (fields) which are: LEVEL and VARIANT. Each property has 7 possibilities: LEVEL can be: Level1 Level2 Level3... Lavel7 And VARIANT: V1 V2 V3... V7 I have created reports which display product belonging to every possible situation: ie. products belonging to LEVEL1 AND V1, products belonging to LEVEL2 AND V1....in this way i have created 49 DIFFERENT reports based on 49 different queries. I was wondering if there is a way to create only ONE query and ONE report which will ask the user for the combination of properties desired (which level and which variant) so that the report displays those products. The main issue is to avoid having to CREATE every single different query AND report with very simple differences. Thanks, Gilberto

推荐答案

您好, 我有一个产品清单,其中包含两个属性(字段):LEVEL和VARIANT。每个物业有7种可能性: 等级可以是: 等级1 等级2 等级3。 .. Lavel7 和VARIANT: V1 V2 V3 ... V7 我创建的报告显示属于每种可能情况的产品: ie。属于LEVEL1和V1的产品,属于LEVEL2和V1的产品....这样我根据49个不同的查询创建了49个不同的报告。 我想知道是否有一种只创建一个查询和一个报告的方法,它将询问用户所需属性的组合(哪个级别和哪个变量),以便报告显示这些产品。 主要问题是避免必须以非常简单的差异创建每个不同的查询和报告。 谢谢, Gilberto Hello, I have a list of products with two properties (fields) which are: LEVEL and VARIANT. Each property has 7 possibilities: LEVEL can be: Level1 Level2 Level3... Lavel7 And VARIANT: V1 V2 V3... V7 I have created reports which display product belonging to every possible situation: ie. products belonging to LEVEL1 AND V1, products belonging to LEVEL2 AND V1....in this way i have created 49 DIFFERENT reports based on 49 different queries. I was wondering if there is a way to create only ONE query and ONE report which will ask the user for the combination of properties desired (which level and which variant) so that the report displays those products. The main issue is to avoid having to CREATE every single different query AND report with very simple differences. Thanks, Gilberto

在这里你可以使用SQL的笛卡尔积。 首先创建一个名为qryLevel的查询。使用ProductID和LEVEL 然后创建一个名为qryVariant的查询使用ProductID和Variant 接下来创建一个名为qryAll的查询喜欢: 从qryLevel中选择*,qryVariant WHERE qryLevel.ProductID = qryVariant.ProductID 这将为每个ProductID提供所有组合。 最后你可以创建一个新的查询,并为LEVEL和/或Variant添加WHERE子句和IN()子句,如 select *来自qryAll,其中Level(''Level1'',''Level3''); 获得主意? Nc; o)

Here you can use the SQL''s Cartesian product. First create a query named "qryLevel" with ProductID and LEVEL Then create a query named "qryVariant" with ProductID and Variant Next create a query named "qryAll" like: select * from qryLevel, qryVariant WHERE qryLevel.ProductID = qryVariant.ProductID This will give all combinations for every ProductID. Finally you could create a new query and add in the WHERE clause for the LEVEL and/or Variant an IN() clause like select * from qryAll where Level in (''Level1'',''Level3''); Getting the idea ? Nc;o)

在这里你可以使用SQL的笛卡尔积。 首先创建一个名为的查询" qryLevel"使用ProductID和LEVEL 然后创建一个名为qryVariant的查询使用ProductID和Variant 接下来创建一个名为qryAll的查询喜欢: 从qryLevel中选择*,qryVariant WHERE qryLevel.ProductID = qryVariant.ProductID 这将为每个ProductID提供所有组合。 最后你可以创建一个新的查询,并为LEVEL和/或Variant添加WHERE子句和IN()子句,如 select *来自qryAll,其中Level(''Level1'',''Level3''); 获得主意? Nc; o) Here you can use the SQL''s Cartesian product. First create a query named "qryLevel" with ProductID and LEVEL Then create a query named "qryVariant" with ProductID and Variant Next create a query named "qryAll" like: select * from qryLevel, qryVariant WHERE qryLevel.ProductID = qryVariant.ProductID This will give all combinations for every ProductID. Finally you could create a new query and add in the WHERE clause for the LEVEL and/or Variant an IN() clause like select * from qryAll where Level in (''Level1'',''Level3''); Getting the idea ? Nc;o)

感谢Nico,我相信这正是我所需要的。 但是我忘了提到每个产品都属于几个变量和/或级别......我不知道这是不是一个问题。 我已创建: qrylevel:

Thanks Nico, i believe this is exactly what i need. However i forgot to mention that every product can belong to several variables and/or levels...i dont know if thats a problem. I already created: qrylevel:

展开 | 选择 | Wrap | 行号

糟糕,您的表格设置已更改为列级别 ;喜欢: L1 L2 L3 如行: 工程.Level1,Engineering.Level2,Engineering.Level3,..... 这种方式在一个表中使用级别被认为是未规范化的。并且不应该这样做,因为它给你现在的选择带来了麻烦。 你的工程表应该是这样的: [产品名称法语],等级 每个等级需要有一行。 同样适用于变种。 具有该设置将使我的查询设置工作,并允许通过过滤具有所需值的字段来过滤每个级别和变体组合。 你能重新设计你的表吗? ? Nic; o) Oops, your table setup changed from "column levels" like: L1 L2 L3 into rows like: Engineering.Level1, Engineering.Level2, Engineering.Level3, ..... The use of levels in one table this way is considered "not normalized" and shouldn''t be done as it gives the selection trouble you''re in now. Your engineering table should look like: [Product Name French], Level For each level a row needs to be present. Same goes for the Variants. Having that setup will make my query setup work and will allow to filter every level and variant combination by filtering the field with the needed value(s). Can you redesign your tables ? Nic;o)

更多推荐

报告根据用户输入进行更改

本文发布于:2023-11-13 11:07:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584197.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报告   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!