最小& Crystal Reports 2008列中的最大值 [英] Minimum & Maximum Values in Crystal Reports 2008 Column

查看:397
本文介绍了最小& Crystal Reports 2008列中的最大值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在Crystal的命令中返回了此列:

  deposit_no 
123
130
125
124
126
127
128
129

$ b p>

我试过一个运行公式的最小和最大值,他们不返回正确的值,无论我怎么操纵他们。我已经尝试评估每个记录,更改deposit_no字段等。我没有在此报告上分组。



编辑添加:
我喜欢在CR端处理这个事情,我改变了我的命令包括什么mson写下面。所以技术上,mson有正确的答案。

解决方案

创建一个存储过程或视图,通过水晶报告访问存储过程或视图。



水晶报告是正确编码任何东西的障碍。



您获得的意外结果可能是因为列不是数字。通常,数值存储为varchar / nvarchar。这是特别为像邮政编码/电话号码等字段。其中值可以是数字,但是你永远不会对它们做数学。



在任何情况下,这里是你可以用来构建sql服务器从水晶调用)



选择min(coalesce(cast_no as int),0))as table_



select max(coalesce(cast(deposit_no as int),0))as max_deposit from tableA


Say I have this column returned in a command for Crystal:

deposit_no
123
130
125
124
126
127
128
129

and I need to have this in the report title:

Includes deposits between 123 - 130

I've tried a running formula for minimum and maximum and they aren't returning the correct values no matter how I manipulate them. I've tried evaluate for every record, on change of the deposit_no field, etc. I have no grouping on this report.

Edited to add: While I preferred to handle this on the CR side of things, I changed my command to include what mson wrote below. So technically, mson had the correct answer.

解决方案

create a stored procedure or view that has the information you want. access the stored procedure or view through crystal reports.

crystal reports is a hindrance to properly coding anything.

the unexpected result you are getting may be because the column is not numeric. often, number values are stored as varchar/nvarchar. this is done especially for fields like zipcode/phone number/etc. where the value may be numeric, but you would never do math on them.

in any event, here are the snippets you can use to build in sql server (and then call from crystal)

select min(coalesce(cast(deposit_no as int),0)) as min_deposit from tableA

select max(coalesce(cast(deposit_no as int),0)) as max_deposit from tableA

这篇关于最小& Crystal Reports 2008列中的最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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