Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server CE / March 2008

Tip: Looking for answers? Try searching our database.

Why is my data stored as .234 and not 0.234?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
The Mad Ape - 06 Mar 2008 14:12 GMT
Hi

I have a quirky SQL problem that I would like solved. I used the
following SQL:

Dim sqlTA As New SqlCeCommand("UPDATE tblStandInfo SET si_samplearea =
(convert(float, si_samplelength) * convert(float, si_samplewidth) /
10000)", getSS)

It works fine except if the answer is less than 1 there is no zero
place holder in the 'ones' position. Why?

For example is the answer is 0.234 it is stored in the db as .234. The
destination field is numeric (20,3) and the two fields used to
calculate it were string that I converted in the SQL statement.

Like I said I am getting the right results just not in a format that I
like. How do I fix this?

Thanks for any help you can provide.

The Mad Ape
www.tatumba.com
Jin - 06 Mar 2008 18:23 GMT
> Hi
>
[quoted text clipped - 18 lines]
>
> The Mad Apewww.tatumba.com

I would think that the data is stored in the DB in the way it's
supposed to, but you are merely seeing the data in the format you're
describing because of the tool being used to view it.  If you're
retrieving the data through code and then displaying it, then you can
format it to whatever you like.  If using a tool, then it'll depend on
what the defaults are for the tool being used.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.