FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Every Other Day Calculation
Every Other Day Calculation
Débuté par M. Beaven, 21 juil. 2003 19:52 - 2 réponses
Connectez-vous…
M. Beaven
#1
Posté le 21 juillet 2003 - 19:52
Greetings all,
I have run into a bit of a pickle while writing a nursing function and wanted to see whether anyone had
coded this problem before. I need to be able to determine "Every other day" based on a beginning
date. The problem is that I cannot simply use IsOdd() or IsEven() due to certain months- i.e-
transitioning from a 31-day month, It would be necessary to move to even days from odd.
Herein is the problem. Does anyone have any ideas for how to determine, given a certain beginning
date, what dates represent "every other day" in relation to this beginning date?
Any help is appreciated.
Regards,
Marc
Signaler
0
0
M. Beaven
#2
Posté le 21 juillet 2003 - 20:28
I believe I have a solution. For every other day, the difference between a given date and
the start date must be even. Therefore, if (IsEven(DateDifference(n,beginning date)))
then true, else false. I believe this will work for my needs in this situation.
Regards,
Marc
Greetings all,
I have run into a bit of a pickle while writing a nursing function and wanted to see whether anyone had coded this problem before. I need to be able to determine "Every other day" based on a beginning date. The problem is that I cannot simply use IsOdd() or IsEven() due to certain months- i.e- transitioning from a 31-day month, It would be necessary to move to even days from odd.
Herein is the problem. Does anyone have any ideas for how to determine, given a certain beginning date, what dates represent "every other day" in relation to this beginning date?
Any help is appreciated.
Regards,
Marc
Signaler
0
0
Mario Reinhöfer
#3
Posté le 21 juillet 2003 - 20:41
Marc,
> I have run into a bit of a pickle while writing a nursing function and
wanted to see whether anyone had
coded this problem before. I need to be able to determine "Every other
day" based on a beginning
> date. The problem is that I cannot simply use IsOdd() or IsEven() due to
certain months- i.e-
transitioning from a 31-day month, It would be necessary to move to even
days from odd.
I (not yet) use Windev, but this should be simple as:
- convert both dates to long values
- run the substraction (result=actual-beginning)
- modulus divide the result by 2
- if 1 -> every other day
HTH
Mario
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte