week finding

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

week finding

Postby Harjo » Mon Aug 04, 2003 4:53 pm

I have a field: date1 (DATETIME) on a specific form with show-properties: dd-MM-YYYY HH:mm

On the same form I have the same field: date1 with show-properties: w

If I search in this last fields, the solution does'nt find anything.

(What I am trying to reach is that I can search for weeknumbers!)

Can this be done?
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby jcompagner » Mon Aug 04, 2003 5:47 pm

you have to search in javascript..

Then make from that week nummer fields 2 dates
(start and end date of that week)

then do a between find

datefield = 4-8-2003|dd-MM-yyyy...10-8-2003|dd-MM-yyyy

(so format the dates you have to strings and give that format back to the find)
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Harjo » Mon Aug 04, 2003 6:58 pm

This is rather complex!
So the way I tryed isn't going to be implemented?

Maybe I can use (the old) fmp plugin and make an extra field: weeknumber. This plugin has a function which calculates the weeknumber.
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby jcompagner » Mon Aug 04, 2003 11:12 pm

Getting the weeknumber is not that difficult. (you can use Utils for that)

But searching with that number over dates in the database (that is want you want yes??) That's another story.

Then you have 2 choices
use a special database function that parse date in the database to the weeknumer and you equal that to the given weeknumber (something like this dateformat(datecolumn,'w') = youreweeknr
But this specialized for databases.

the other is as a said before. Generate a between call over a end and a start date (of the week)
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby cheeser » Wed Aug 06, 2003 11:33 pm

Can you give an example on how to find the start and end date of a week?
cheeser
 


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 13 guests