简体   繁体   English

Crystal Report连接两个以上具有多个条件的表

[英]Crystal Report Join two tables with more than one condition

my challenge for this day is join a table on crystal without a database-command instead work based on grafic with selection of mysql-tables. 我今天的挑战是在没有数据库命令的情况下在Crystal上加入表,而是基于grafic并选择mysql-tables来工作。

Sorry if i use the wrong translation for the menüs, but i only have a german version. 对不起,如果我为菜单使用了错误的翻译,但我只有德语版本。

It means in the database-expert there are selected databasetables instead selecting "add command". 这意味着在数据库专家中选择了数据库表,而不是选择“添加命令”。 Unfortunately, the report ist created from another person and now i have to alter it. 不幸的是,该报告员是由另一个人创建的,现在我必须对其进行更改。

A simple join is not the problem based on ids. 一个简单的连接不是基于id的问题。 in the profiler i can see 在探查器中,我可以看到

inner join table2 on id = id

All right. 好吧。 But what i neer is a further condition: 但是我更需要进一步的条件:

on id = id AND (timefrom1 BETWEEN time_to AND time_end or time_to is null)

Is there a way to manage this with bumping pixels? 有办法解决像素增加的问题吗?

The problem is: If i change to a sql-command, all fields in the report and the formulars are become canceld. 问题是:如果我更改为sql命令,则报表和公式编制器中的所有字段都将被取消。 so ist extreamly hard to change the whle report to a sql command. 因此,很难将所有报告更改为sql命令。

Hopefully you can help me. 希望你能帮助我。

Thanks Frank 谢谢弗兰克

how did you go with this one? 你是怎么做到的? I actually haven't defined my tables and links within the Crystal Report file before, so I had to have a play around first to see what you meant. 实际上,我之前没有在Crystal Report文件中定义表和链接,因此我必须先进行一些操作才能了解您的意思。

Rather than include this new filter in your join (which I don't think you can do anyway), have you tried defining this criteria in your Record Selection? 您是否尝试在记录选择中定义此条件,而不是在联接中包括这个新过滤器(我仍然认为您不能这样做)? Are you aware of how to do this? 您知道该怎么做吗? This article covers the Select Expert and Record Selection. 本文介绍了选择专家和记录选择。

This should avoid the problem of losing fields when redefining your data set. 这应该避免在重新定义数据集时丢失字段的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM