访问选择查询字段表达式中的函数 [英] Access choose function in query field expression

查看:68
本文介绍了访问选择查询字段表达式中的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好 -


有一个包含以下字段的表:

PK *,Equipment_ID,Battery_Serial

* =任意主键

每台设备都有0到3个电池,每个电池都有一个非连续的序列号。不幸的是,这为每件设备创建了多条记录。我想要一个查询,将每个设备的信息合并到一行。我需要的字段是:

Equipment_ID,Battery_1_Serial,Battery_2_Serial,Battery_3_Serial


如果不存在电池的序列号为空,我不在乎。


我认为通过使用表达式构建器中的Choose()函数我在正确的轨道上,但是我无法开发正确的选择变量。我尝试将表中的Equipment_ID与查询中的一个进行比较,但这是循环逻辑。


这是一个中等优先级的项目,因为我不需要它直到四月第9位。谢谢。


Matt

Good afternoon-

There is a table with the following fields:
PK*, Equipment_ID, Battery_Serial
*= arbitrary primary key

Each piece of equipment has between 0 and 3 batteries, and each battery has a non-sequential serial number. Unfortunately, this creates multiple records for each piece of equipment. I want a query that consolidates the information onto a single line for each piece of equipment. The fields I need are:
Equipment_ID, Battery_1_Serial, Battery_2_Serial, Battery_3_Serial

I don''t care if the serial numbers are null for non-existent batteries.

I thought I was on the right track by using the Choose() function in the expression builder, but I can''t develop the proper choices variable. I tried comparing the Equipment_ID from the table to the one in the query, but that was circular logic.

This is a medium priority item, as I don''t need it until April 9th. Thank you.

Matt

推荐答案


下午好 -


有一个包含以下字段的表:

PK *,Equipment_ID,Battery_Serial

* =任意主键


每件设备都有0到3个电池,每个电池都有一个非连续的序列号。不幸的是,这为每件设备创建了多条记录。我想要一个查询,将每个设备的信息合并到一行。我需要的字段是:

Equipment_ID,Battery_1_Serial,Battery_2_Serial,Battery_3_Serial


如果不存在电池的序列号为空,我不在乎。


我认为通过使用表达式构建器中的Choose()函数我在正确的轨道上,但是我无法开发正确的选择变量。我尝试将表中的Equipment_ID与查询中的一个进行比较,但这是循环逻辑。


这是一个中等优先级的项目,因为我不需要它直到四月第9位。谢谢。


马特
Good afternoon-

There is a table with the following fields:
PK*, Equipment_ID, Battery_Serial
*= arbitrary primary key

Each piece of equipment has between 0 and 3 batteries, and each battery has a non-sequential serial number. Unfortunately, this creates multiple records for each piece of equipment. I want a query that consolidates the information onto a single line for each piece of equipment. The fields I need are:
Equipment_ID, Battery_1_Serial, Battery_2_Serial, Battery_3_Serial

I don''t care if the serial numbers are null for non-existent batteries.

I thought I was on the right track by using the Choose() function in the expression builder, but I can''t develop the proper choices variable. I tried comparing the Equipment_ID from the table to the one in the query, but that was circular logic.

This is a medium priority item, as I don''t need it until April 9th. Thank you.

Matt



没有字段告诉我们串口是否用于电池1,2 ,或3?

There''s no field that tells us whether the serial is for battery 1, 2, or 3?



没有字段告诉我们串口是用于电池1,2还是3?
There''s no field that tells us whether the serial is for battery 1, 2, or 3?



不幸的是没有。我无法控制数据库的结构/关系,所以我受建筑师的支配。


我猜它与电池的数量(1,2,3)通常不重要的事实有关。

感谢您的快速回复。


Matt

Unfortunately no. I have no control over the structure/relationships of the database, so I am at the mercy of the architects.

I am guessing it has something to do with the fact that the number (1,2,3) of the battery doesn''t usually matter.

Thank you for the quick response.

Matt


好吧,以此方式我想到了一个交叉表查询但是没有一个字段来指定它是哪个电池,我们将不得不创建它。是否可以安全地假设电池系列是独一无二的,并且他们不会切换到不同的设备并且所有设备将至少有2个电池?
Well to get it that way I was thinking of a crosstab query but without a field to specify which battery it is, we''ll have to create it. Is it safe to assume that battery serials are unique and that they won''t be switched around to different equipment and that all the equipment will have at least 2 batteries?


这篇关于访问选择查询字段表达式中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆