|
|
#1 |
|
Lively Member
Join Date: Nov 02
Posts: 83
![]() |
First and Last Day Of Month
Hi Friends I need to Know the First and Last Day of Month . The PArameter is of Month Code.... i m using Seagate Crystal Report 8. ....
|
|
|
|
|
|
#2 |
|
Addicted Member
Join Date: Aug 04
Location: Itasca, IL USA
Posts: 165
![]() |
Re: First and Last Day Of Month
Hi there.. I was justing searching the forums to find a way to get the last day in any given month in Crystal Reports.
Did you ever figure that out? |
|
|
|
|
|
#3 |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
Well the first day of the Month should be the first, right
?and you could use the following to find the last day of the month: VB Code:
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
#4 |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
Here is another LINK that finds the number of days in a month
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
#6 | |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
Quote:
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
|
#7 |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
But here is the CR Formula:
VB Code:
@ Shakti - Looks like my code in post #3 except without the Variable.
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
#8 |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
Here are a few other links I found:
http://www.tek-tips.com/faqs.cfm?fid=1960 http://www.crystalreportsbook.com/Cr...I.asp?Page=7_3
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
#9 |
|
VB Guru
Join Date: Dec 05
Location: Sharjah, United Arab Emirates
Posts: 3,031
![]() ![]() ![]() |
Re: First and Last Day Of Month
@Mark Gambo, if you find the last day of the month that itself will tell you the no of days in that month...lol...
__________________
If an answer to your question has been helpful, then please, Rate it! Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes. ![]() http://ganeshmoorthymc.com |
|
|
|
|
|
#10 | |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
Quote:
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
|
#11 | |
|
Just Married
Join Date: Mar 06
Location: Udaipur,Rajasthan(INDIA)
Posts: 3,742
![]() ![]() |
Quote:
|
|
|
|
|
|
|
#12 | |
|
Giants World Champs!!!!
Join Date: Sep 03
Location: Colorado
Posts: 2,965
![]() ![]() ![]() |
Re: First and Last Day Of Month
Quote:
__________________
Regards, Mark Please remember to rate posts! Rate any post you find helpful. |
|
|
|
|
|
|
#13 |
|
Just Married
Join Date: Mar 06
Location: Udaipur,Rajasthan(INDIA)
Posts: 3,742
![]() ![]() |
I am making the formula in the CR related to it. And I am not discussing here on the VB property like dtpicker, the people here related on the reporting post, let wait for the thread starter reply.
Dtpicker is not a metter here. |
|
|
|
|
|
#14 | |
|
Just Married
Join Date: Mar 06
Location: Udaipur,Rajasthan(INDIA)
Posts: 3,742
![]() ![]() |
Quote:
|
|
|
|
|
|
|
#15 |
|
New Member
Join Date: Jul 09
Posts: 2
![]() |
Re: First and Last Day Of Month
'try this......... 2 DTpicker set to First and Last day of the month
Private Sub Form_Load() DTPicker1.Value = DateAdd("d", -(Day(Date) - 1), Date) DTPicker2.Value = DateAdd("d", (getNumberOfDays - 1), DTPicker1.Value) End Sub 'Get the number of days each month is having Public Function getNumberOfDays() As Integer Select Case DateTime.Month(Date) Case 1, 3, 5, 7, 8, 10, 12 getNumberOfDays = 31 Case 4, 6, 9, 11 getNumberOfDays = 30 Case 2 'logic for checking leap years If (Year(Date) Mod 4) = 0 Then If (Year(Date) Mod 100) = 0 Then If (Year(Date) Mod 400) = 0 Then getNumberOfDays = 29 Else getNumberOfDays = 28 End If Else getNumberOfDays = 29 End If Else getNumberOfDays = 28 End If End Select End Function |
|
|
|
|
|
#16 |
|
New Member
Join Date: Jul 09
Posts: 2
![]() |
Re: First and Last Day Of Month
'try this......... 2 DTpicker set to First and Last day of the month
Private Sub Form_Load() DTPicker1.Value = DateAdd("d", -(Day(Date) - 1), Date) DTPicker2.Value = DateAdd("d", (getNumberOfDays - 1), DTPicker1.Value) End Sub 'Get the number of days each month is having Public Function getNumberOfDays() As Integer Select Case DateTime.Month(Date) Case 1, 3, 5, 7, 8, 10, 12 getNumberOfDays = 31 Case 4, 6, 9, 11 getNumberOfDays = 30 Case 2 'logic for checking leap years If (Year(Date) Mod 4) = 0 Then If (Year(Date) Mod 100) = 0 Then If (Year(Date) Mod 400) = 0 Then getNumberOfDays = 29 Else getNumberOfDays = 28 End If Else getNumberOfDays = 29 End If Else getNumberOfDays = 28 End If End Select End Function |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|