Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get Week number for date for month
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01219925
Message ID:
01231966
Vues:
13
My code considers the first week of the month to be from 1 to 7, the second from 8 to 14, etc.
What's your definition of week of the month?

>
>I thought this was working correctly, but for the month of June that has five weeks, it not quite right. I think it is a INT() or rounding issue, but not sure how to correct it, hoping you pull a little more from your knowledge
>
>Declare @begintime datetime
>set @begintime = '06/01/2007 00:00:00'
>
>
>(DAY(@Begintime)-1)/7 + 1 as WeekOfMonth && Returns 1 which is correct
>
>set @begintime = '06/04/2007 00:00:00'
>(DAY(@Begintime)-1)/7 + 1 as WeekOfMonth && Returns 1 Also but this is should be 2
>
>
>Thanks for any more help or pointers you could give me.
>
>Kirk
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform