PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD22} SQLCol() removing trailing zeros
[WD22} SQLCol() removing trailing zeros
Iniciado por rob, 28,ago. 2018 15:19 - 3 respuestas
Miembro registrado
105 mensajes
Publicado el 28,agosto 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.
Mensaje modificado, 28,agosto 2018 - 15:20
Publicado el 28,agosto 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.
Miembro registrado
127 mensajes
Publicado el 29,agosto 2018 - 09:30
my guess

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

meikl ;)
Miembro registrado
105 mensajes
Publicado el 30,agosto 2018 - 21:14
Thanks for the tips!