从2个表项列表中查询一次 [英] query from 2 tables list of items just once

查看:45
本文介绍了从2个表项列表中查询一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面有这个代码,它从tbl_bookings中获取1个事件的数据。每个事件都有一个分配给它的房间存储在tbl_roombookings中。但他们可以分配一个以上的房间说房间1 2和3


当前这个显示在底部的窗口中,作为某一天事件的快速查看。我希望他们也能在他们旁边展示,但是当我尝试添加任何东西时,它会将事件列为多次,因为有房间。

展开 | 选择 | Wrap | 行号

解决方案

我认为你所寻找的是从相关记录中连接值


它可用于将多列上的列取出并从中生成一个值。

这样的事情?我得到一个编译错误所以猜测我把错误的顺序放在了一起。用完整个VB脚本和SQL语句的新东西。

展开 | 选择 | Wrap | 行号


这可能更接近:

展开 | 选择 | Wrap | 行号


i have this code below which pull the data from tbl_bookings for 1 event. each event has a room(s) allocated to it stored in tbl_roombookings. But they can have more than one room allocated say room 1 2 and 3

currenly this is shown in a window at the bottom as a quick view for the events on a certain day. i would like for them to be show next to them as well but when i try and add anything it then has the event listed multipul times as there are rooms.

Expand|Select|Wrap|Line Numbers

解决方案

I think what your looking for is Concatenate values from related records

It can be used to take a Column over Multiple rows and make one Value out of it.


something like this? i''m getting a compile error so guessing that i put something in the wrong order.Still new with the whole VB scripting and SQL statements.

Expand|Select|Wrap|Line Numbers


This might be closer:

Expand|Select|Wrap|Line Numbers


这篇关于从2个表项列表中查询一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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