在两个视图之间进行左连接时应用程序崩溃 - 迫切需要帮助 [英] Application crashes when doing Left join between two views - Need help urgently

查看:133
本文介绍了在两个视图之间进行左连接时应用程序崩溃 - 迫切需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在两个视图之间进行左连接,其中ON条件中使用的列在第一个视图中有空字符串行。在运行查询时,应用程序闪烁,显示某些行的#ERROR值并挂起。

它是一段简单的代码,但它不起作用......


SELECT cstr([更新的交易在一个月内存活]。[最后滚动日期]),cstr([3m CDOR率]。日期)从[更新的活动在一个月内活着]

左外连接[3m CDOR率]

修剪(cstr([更新的交易在一个月内活动]。[最后滚动日期]))=修剪(cstr([3m CDOR率]。日期))


急需帮助.. 。

Maria

Hi,

I am doing a Left Join between two views wherein the column used in the ON condition has empty string rows in the first view. while running the query the application flashes, shows #ERROR value for some of the rows and hangs.
its a simple piece of code but its not working......

SELECT cstr([Updated Deals alive in a month].[Last Roll Date]), cstr([3m CDOR rates].Date) from [Updated Deals alive in a month]
Left outer join [3m CDOR rates]
on trim(cstr([Updated Deals alive in a month].[Last Roll Date])) = trim(cstr([3m CDOR rates].Date))

need help urgently...
Maria

推荐答案

你好,Maria。


CStr()函数不能'' t得到Null作为参数。

同时Nz()无法使用,因为它会导致Null值的连接。

我想你应该先过滤你的表获取连接字段不为空的记录然后加入结果数据集。


顺便说一句,为什么你不想加入字段而不将它们转换为字符串?


问候,

Hello, Maria.

CStr() function couldn''t get Null as argument.
At the same time Nz() could not be used because it will cause join on Null values.
I suppose you should first filter your tables to get records where join fields are not Null and then join resulting datasets.

BTW, why don''t you want to join on the fields as they are without converting them to strings?

Regards,
Fish





指定的列中没有空值 - 它们是空字符串。另外要说ON条件中的第一列是来自视图并且是数据类型字符串,而第二列''Date''列来自表,其数据类型是''Date / Time''。这就是我将它们转换为字符串的原因。
如何解决这个问题?


Maria
Hi,

There are no null values in the column specified - they are empty strings. Also to mention that the first column in the ON condition is from a view and is of datatype string whereas the second ''Date'' column is from a table and its datatype is ''Date/Time''. thats why I am converting them to strings.
How do I go about it?

Maria



...

指定列中没有空值 - 它们是空字符串....
...
There are no null values in the column specified - they are empty strings....



你怎么知道这个?

How do you know this?


这篇关于在两个视图之间进行左连接时应用程序崩溃 - 迫切需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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