gpt4 book ai didi

reporting - 自定义报告表查询 bool 列

转载 作者:行者123 更新时间:2023-12-03 03:27:39 24 4
gpt4 key购买 nike

我是 Kentico 的新手,到目前为止我非常享受开发过程!我已经用尽了所有的搜索努力,并认为我应该联系社区。我正在使用 Kentico 内置的报告创建自定义报告(确切地说是表格)。我有一个自定义查询:

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 作为“复选框 - 未选中或选中”而不是 True 或 False 出现。在实际的表格和数据中,它显示 True/False。有没有办法解决?感谢您的帮助!

最佳答案

我得到了相同的复选框,您可以通过将 bool (位)字段包装在 CASE 中来获取文本值。您的报告表查询将如下所示;

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

关于reporting - 自定义报告表查询 bool 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33766582/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com