Programming 笔记

工作中遇到的问题就记载这里

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Recently I met a strange problem. That tooks me a few hours to dig out the cause.

I has a textbox in a access form, the textbox value is SUM([price]), the price can be decimal number, but the textbox only display the integer. For example, the price is 1.1 and the other price 1.3. Then the textbox display me 2.

The field price is a calculated value which is ItemPrice * Discount / 100, ItemPrice and Discount are fields in physical table.

I found ItemPrice data type is Long Integer. I changed it to Single. Then textbox display correct value with decimal point.

So my summary is if do aggregation function to a calculated field, the aggregration function force return data type to longest data type among physical fields involved.

posted on 2009-05-12 18:13  IT 笔记  阅读(301)  评论(0编辑  收藏  举报