week finding

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?

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)

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.

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)

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