PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Question about Table based on a query
Question about Table based on a query
Iniciado por guest, 27,may. 2016 11:18 - 5 respuestas
Publicado el 27,mayo 2016 - 11:18
Hi,

I created table based on a query to display incoming contract renewals for employees.
I want to display only contracts that are due in 10 days.

How can I do this? And if you have any better suggestions, I would be happy to accept :)

Kind Regards,
Safaas
Publicado el 27,mayo 2016 - 11:59
Modify your query ????
so you can select on dates ??
Publicado el 27,mayo 2016 - 12:13
I have employee who signed contract on 27.05.2015 and contract renewal is on 27.05.2016.
I want to create a notice table which will inform me 10 days before contract ends that it needs to be renewed.

I found in query that you can set condition to equal the preset date (year and month), which is nice, but it takes into account the days that have passed in that month.
Publicado el 27,mayo 2016 - 12:54
Hey Safaas,

Take a look at this example of SQL with dates - it may help?
http://27130.foren.mysnip.de/read.php…
Publicado el 27,mayo 2016 - 21:51
Safaas

Just do a bit of programming in Wlanguage

example:

nDateasint is int // a var for the date as int
test is Date// a var for the date

nDateasint = DateToInteger(TABLE_Bestelling.COL_Besteldatum,False)
// Here i tabe the date from a table and make it an integer

nDateasint = nDateasint - 10
// here I take 10 of the calculated number

test = IntegerToDate(nDateasint,"yyyymmdd")
// here I make a date from the calculated int

EDT_datemdue = test

// Here I put it into an edt control on the page

You can do similar calc. If you want the result in a table just use tableaddline to add a row to the table

Regards

PS
w languadge is easier then doing this in sql

regards
Allard
Publicado el 28,mayo 2016 - 08:49
Hi Safaas,

in w-language:

ldDate is date // default is today
ldDate..day -= 10 // calculate 10 days earlier

// use this date as parameter of your query

YourQuery..CalcDate = ldDate

// YourQuery (part):
...
WHERE YourFile..Date >= {CalcDate}

I hope this helps.