Jan 17, 2002 #1 klasse Programmer Jan 12, 2004 32 SE Hi, Is there any function with which I could get the last day of the month in the format 31/01/02 (for this month for example)? Or at least, a function to get the number of days of this month ? Thanks, Klasse
Hi, Is there any function with which I could get the last day of the month in the format 31/01/02 (for this month for example)? Or at least, a function to get the number of days of this month ? Thanks, Klasse
Jan 17, 2002 #2 MichaelRed Programmer Dec 22, 1999 8,410 US ? Dateserial(Year(Date), MOnth(Date) + 1, 0) 1/31/02 ? Day(Dateserial(Year(Date), MOnth(Date) + 1, 0)) 31 ? Format(Dateserial(Year(Date), MOnth(Date) + 1, 0), "dd/mm/yy" 31/01/02 MichaelRed m.red@att.net There is never time to do it right but there is always time to do it over Upvote 0 Downvote
? Dateserial(Year(Date), MOnth(Date) + 1, 0) 1/31/02 ? Day(Dateserial(Year(Date), MOnth(Date) + 1, 0)) 31 ? Format(Dateserial(Year(Date), MOnth(Date) + 1, 0), "dd/mm/yy" 31/01/02 MichaelRed m.red@att.net There is never time to do it right but there is always time to do it over
Jan 17, 2002 #3 jebry Programmer Aug 6, 2001 3,006 US Hi Klasse! Try this: Format(DateAdd("d", -1, DateSerial(Year(Date(), Month(Date() + 1), 1), "dd/mm/yy" To get the number of days in the month use this: DateDiff("d", Date(), DateAdd("m", 1, Date())) hth Jeff Bridgham bridgham@purdue.edu Upvote 0 Downvote
Hi Klasse! Try this: Format(DateAdd("d", -1, DateSerial(Year(Date(), Month(Date() + 1), 1), "dd/mm/yy" To get the number of days in the month use this: DateDiff("d", Date(), DateAdd("m", 1, Date())) hth Jeff Bridgham bridgham@purdue.edu
Jan 17, 2002 Thread starter #4 klasse Programmer Jan 12, 2004 32 SE Many thanks to the two of you, I will try both solutions. Klasse Upvote 0 Downvote