PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Storing a number with potential decimal digits
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Storing a number with potential decimal digits

Réponse
 
LinkBack Outils de la discussion
Vieux 15/07/2008, 18h05   #1
Louis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Storing a number with potential decimal digits

I am new to MSSQL and I was set up to access this server so I can store data
in it, either through ColdFusion or MS Access. Not sure about the version of
MSSQL.

My problem: Among other fields, I have two similar fields which are numbers
with 0,1 or 2 decimal digits. For example, the first field (normally) has 7
digits to the left of the decimal point -> 1234567.1, or 1234567 or
1234567.12.
The second field is similar but with 6 digits -> 123456.1, or 123456 or
1234567.12.

I tried different data types and they seem to give me the same results when
looking at it through MS Access ODBC:
I used decimal(10,2) for both and the result is the first field's data is
truncated, ie it always comes back as 1234567 while the second field is OK.

If I dropped a digit in Access in the first field and add a digit, then it
accepts it.

Why is this happening? I would think the number of digits I declared would
be sufficient.

Appreciate for any comment or suggestions.

  Réponse avec citation
Vieux 16/07/2008, 08h28   #2
Uri Dimant
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Storing a number with potential decimal digits

Louis
Where do you run it? Access or SQL Server?



"Louis" <Louis@discussions.microsoft.com> wrote in message
news:53AC65F9-3BF7-45B9-A068-32C5B58F44EB@microsoft.com...
>I am new to MSSQL and I was set up to access this server so I can store
>data
> in it, either through ColdFusion or MS Access. Not sure about the version
> of
> MSSQL.
>
> My problem: Among other fields, I have two similar fields which are
> numbers
> with 0,1 or 2 decimal digits. For example, the first field (normally) has
> 7
> digits to the left of the decimal point -> 1234567.1, or 1234567 or
> 1234567.12.
> The second field is similar but with 6 digits -> 123456.1, or 123456 or
> 1234567.12.
>
> I tried different data types and they seem to give me the same results
> when
> looking at it through MS Access ODBC:
> I used decimal(10,2) for both and the result is the first field's data is
> truncated, ie it always comes back as 1234567 while the second field is
> OK.
>
> If I dropped a digit in Access in the first field and add a digit, then it
> accepts it.
>
> Why is this happening? I would think the number of digits I declared would
> be sufficient.
>
> Appreciate for any comment or suggestions.
>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h03.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07489 seconds with 10 queries