PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → How to - query formula (concatenate database and constant strings)
How to - query formula (concatenate database and constant strings)
Iniciado por vvido, 31,jul. 2018 13:51 - 2 respuestas
Miembro registrado
94 mensajes
Publicado el 31,julio 2018 - 13:51
I need to create a query which will return two strings from HFSQL table in a readable form.
This value must be provided from the query - scheduler control displays the value from the query (no formatting is possible before displaying it)

what I need is
SELECT

WL.DateToString(SCHEDULE.StartDate, maskSystemDate ) + " " + WL.DateToString(SCHEDULE.EndDate, maskSystemDate) AS Formula2
FROM


I have both date values in the table, but I can not insert the delimiter between two strings.
Query editor allows me to enter the following expression
...
WL.DateToString(SCHEDULE.StartDate) + WL.DateToString(SCHEDULE.EndDate) AS Formula2
FROM

Problem 1: How to add the constant string to the formula (i.e. " ")
Problem 2: How to format the date in the desired format

[WB23] classic HFSQL
Publicado el 31,julio 2018 - 14:24
Hi,

I haven't tried, but it seems to me that you could do something like

WL.DateToString(SCHEDULE.StartDate,"YYYY-MM-DD") + WL.repeat(" ",1) +
WL.DateToString(SCHEDULE.EndDate,"YYYY-MM-DD") AS Formula2


Of course, you need to insert YOUR format instead of the "YYYY-MM-DD"...

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 7/31/2018 5:51 AM, vvido wrote:
I need to create a query which will return two strings from HFSQL table
in a readable form.
This value must be provided from the query - scheduler control displays
the value from the query (no formatting is possible before displaying it)

what I need is SELECT  …
   WL.DateToString(SCHEDULE.StartDate, maskSystemDate )  + "  " +
WL.DateToString(SCHEDULE.EndDate, maskSystemDate)  AS Formula2
FROM  …

I have both date values in the table, but I can not insert the delimiter
between two strings.
Query editor allows me to enter the following expression
...
   WL.DateToString(SCHEDULE.StartDate)  +
WL.DateToString(SCHEDULE.EndDate)  AS Formula2
FROM
Problem 1: How to add the constant string to the formula (i.e. " ")
Problem 2: How to format the date in the desired format

[WB23] classic HFSQL
Miembro registrado
94 mensajes
Publicado el 31,julio 2018 - 16:10
Thanks Fabrice,

but the problem is in quotes !!
SINGLE QUOTES MUST BE USED

I have expected double quotes since I am calling WLanguage procedure.
For example this works

WL.Replace(WL.DateToString(SCHEDULE.StartDate),'/','.') + ' - ' + WL.Replace(WL.DateToString(SCHEDULE.EndDate),'/','.')

or better


WL.DateToString(SCHEDULE.StartDate),'DD.MM.YYYY'') + ' - ' ...