自定义报告 Table 查询布尔列
Custom Reporting Table Query Boolean Column
我是 Kentico 的新手,到目前为止我真的很喜欢开发!我已经用尽了所有的搜索努力,并认为我会接触到社区。我正在使用 Kentico 内置的报告创建自定义报告(准确地说是 table)。我有一个自定义查询:
Select FirstName as [First Name], LastName as [Last Name], Email, Phone, StreetAddress as [Street Address], City, State, Country, Zip, Email, Phone, PaymentDate as [Payment Date], TransactionID as [Transaction ID], PaymentStatus as [Payment Status]
from TableName E
WHERE E.ID = 1 AND E.PaymentStatus = False
ORDER BY E.ItemCreatedWhen ASC
我发现的问题是 PaymentStatus 作为 "Checkbox - unchecked or checked" 而不是 True 或 False 出现。在实际 table 和数据中它显示 True/False。有没有办法解决?感谢您的帮助!
我得到了相同的复选框,您可以通过将布尔(位)字段包装在 CASE 中来获取文本值。您的报告 table 查询将如下所示;
SELECT FirstName as [First Name], LastName as [Last Name], Email, Phone, StreetAddress as [Street Address], City, State, Country, Zip, Email, Phone, PaymentDate as [Payment Date], TransactionID as [Transaction ID],
CASE WHEN PaymentStatus = 0 THEN 'False'
ELSE 'True'
END as [Payment Status]
FROM TableName E
WHERE E.ID = 1
AND E.PaymentStatus = False
ORDER BY E.ItemCreatedWhen ASC
我是 Kentico 的新手,到目前为止我真的很喜欢开发!我已经用尽了所有的搜索努力,并认为我会接触到社区。我正在使用 Kentico 内置的报告创建自定义报告(准确地说是 table)。我有一个自定义查询:
Select FirstName as [First Name], LastName as [Last Name], Email, Phone, StreetAddress as [Street Address], City, State, Country, Zip, Email, Phone, PaymentDate as [Payment Date], TransactionID as [Transaction ID], PaymentStatus as [Payment Status]
from TableName E
WHERE E.ID = 1 AND E.PaymentStatus = False
ORDER BY E.ItemCreatedWhen ASC
我发现的问题是 PaymentStatus 作为 "Checkbox - unchecked or checked" 而不是 True 或 False 出现。在实际 table 和数据中它显示 True/False。有没有办法解决?感谢您的帮助!
我得到了相同的复选框,您可以通过将布尔(位)字段包装在 CASE 中来获取文本值。您的报告 table 查询将如下所示;
SELECT FirstName as [First Name], LastName as [Last Name], Email, Phone, StreetAddress as [Street Address], City, State, Country, Zip, Email, Phone, PaymentDate as [Payment Date], TransactionID as [Transaction ID],
CASE WHEN PaymentStatus = 0 THEN 'False'
ELSE 'True'
END as [Payment Status]
FROM TableName E
WHERE E.ID = 1
AND E.PaymentStatus = False
ORDER BY E.ItemCreatedWhen ASC