473,385 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Data type enforcement error

kk
Hello everybody!
I have an access database (obviously!) and I have the following
problem: data doesn't seem to be stored in the tables according to the
datatype that I have declared in the table's data type definition.

Let's say I have a table A with a field B that has the following
properties:

Data Type: Number
Field size: Single
Format: Euro
Decimal places: 2

If I store the value "48.35" for example, and I try later to edit that
record, the value that appears to the screen is "48.35 E" (where E is
the Euro sign), but when I click to the textbox to edit that value,
the textbox displays the value "48,3499984741211".

Sep 28 '07 #1
5 1241
The Format property does not enforce decimal places
to store only 2 decimals you'd have to use the round function

HTH

Pieter

"kk" <kk****@gmail.comwrote in message
news:11**********************@22g2000hsm.googlegro ups.com...
Hello everybody!
I have an access database (obviously!) and I have the following
problem: data doesn't seem to be stored in the tables according to the
datatype that I have declared in the table's data type definition.

Let's say I have a table A with a field B that has the following
properties:

Data Type: Number
Field size: Single
Format: Euro
Decimal places: 2

If I store the value "48.35" for example, and I try later to edit that
record, the value that appears to the screen is "48.35 E" (where E is
the Euro sign), but when I click to the textbox to edit that value,
the textbox displays the value "48,3499984741211".

Sep 28 '07 #2
kk
Thanks Pieter for your answer.
I do not understand at which point do you suggest that I should use
the Round function. At the OnGotFocus event of the textbox that
contains the value, or at the BeforeUpdate event of the form?

Sep 28 '07 #3
Depends on when you want the data updated (where it comes from)
if it is calculated in the form, the before_update springs to mind, else I'd
Use the Form_Current I think.

Pieter

"kk" <kk****@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
Thanks Pieter for your answer.
I do not understand at which point do you suggest that I should use
the Round function. At the OnGotFocus event of the textbox that
contains the value, or at the BeforeUpdate event of the form?

Sep 28 '07 #4
kk
I need to be able to sum up these values... so perhaps I should also
use Sum(Round(field)).

Thank you very much for your help!

Sep 28 '07 #5
de nada
just remember to use Round(x,2)

btw
if it's money use round(sum(x)) instead <g>

Pieter

"kk" <kk****@gmail.comwrote in message
news:11*********************@19g2000hsx.googlegrou ps.com...
>I need to be able to sum up these values... so perhaps I should also
use Sum(Round(field)).

Thank you very much for your help!

Sep 28 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Rob Long | last post by:
Hey I've noticed a somewhat annoying feature in PHP5 when it comes to extended classes and types. If I declare an interface and a class that implements it, I get a "compile" error (read parse...
3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
18
by: Joel Hedlund | last post by:
Hi! The question of type checking/enforcing has bothered me for a while, and since this newsgroup has a wealth of competence subscribed to it, I figured this would be a great way of learning...
63
by: time.swift | last post by:
Coming from a C++ / C# background, the lack of emphasis on private data seems weird to me. I've often found wrapping private data useful to prevent bugs and enforce error checking.. It appears...
0
by: Winder | last post by:
Computer Data Recovery Help 24/7 Data recovering tools and services is our focus. We will recover your data in a cost effective and efficient manner. We recover all operating systems and media....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.