Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Month by Month Form and Report
Message
De
07/08/2000 18:52:58
 
 
À
07/08/2000 18:09:17
N. Lea
Nic Cross Enterprises
Valencia, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00401977
Message ID:
00401993
Vues:
21
So if the user selects August the report should run from September 30, 2000 to September 30, 2001?
You've already got how to print the date range, so I'm guessing you need to be able to get the end of the following month.
With VFP >=SP3, I'd use the new capabilities of the DATE() command. e.g.,
In this case, I am assuming that year is always the current year, but I have included an alternate in case it isn't...
lnMonth = thisform.spnMonth.Value
** if date: lnMonth = MONTH(thisform.txtDate.Value)
lnYear = YEAR(DATE())
** if date: YEAR(thisform.txtDate.Value)

ldStart = GOMONTH(DATE(lnYear, lnMonth, 1),2)-1
ldEnd = GOMONTH(DATE(lnYear+1, lnMonth, 1),2)-1
With VFP before sp3:
lnMonth = thisform.spnMonth.Value
** if date: lnMonth = MONTH(thisform.txtDate.Value)
lnYear = YEAR(DATE())
** if date: YEAR(thisform.txtDate.Value)

ldStart = GOMONTH(CTOD(ALLTRIM(STR(lnMonth))+"/01/"+ALLTRIM(STR(lnYear))),2)-1
ldEnd = GOMONTH(CTOD(ALLTRIM(STR(lnMonth))+"/01/"+ALLTRIM(STR(lnYear+1))),2)-1
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform