Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Month by Month Form and Report
Message
From
07/08/2000 18:52:58
 
 
To
07/08/2000 18:09:17
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00401977
Message ID:
00401993
Views:
20
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform