PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 23 → [WD22} SQLCol() removing trailing zeros
[WD22} SQLCol() removing trailing zeros
Débuté par Robert, 28 aoû. 2018 15:19 - 3 réponses
Membre enregistré
92 messages
Posté le 28 août 2018 - 15:19
Is there a way to get SQLCol() to not remove trailing zeroes from a result field?

I have a query against an SQL database connected via SQLConnect(sServer, sUser, sPassword, sDatabase, "OLEDB", hOledbSQLServer) with one column specifically formatted with 5 decimal places. But SQLCol() is getting rid of all of the zeroes at the end, so when the result is for example 27.25000 it's cutting it off as 27.25.
Message modifié, 28 août 2018 - 15:20
Posté le 28 août 2018 - 23:55
Hi Robert,

it looks like your column is of numerical type... if that is correct,
then the 5 decimal thingy is ONLY at the DISPLAY level... the value is
27.25; no matter what DB is used

Now, if you want to STORE 27.25000 in the DB, it has to be in a
STRING,and in that case, you will get the string with the zero on the
windev side.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on http://www.fabriceharari.com


On 8/28/2018 7:19 AM, Robert wrote:
Is there a way to get SQLCol() to not remove trailing zeroes from a
result field?

I have a query against an SQL database connected via SQLConnect(sServer,
sUser, sPassword, sDatabase, "OLEDB", hOledbSQLServer) with one column
specifically formatted with 5 decimal places. But SQLCol() is getting
rid of all of the zeroes at the end, so when the result is for example
27.25000 it's cutting it off as 27.25.
Membre enregistré
85 messages
Posté le 29 août 2018 - 09:30
my guess

as it is returned as a native number you have to adjust the imputmask-property for visualizing

meikl ;)
Membre enregistré
92 messages
Posté le 30 août 2018 - 21:14
Thanks for the tips!