Admit have a var ANNO="2010" and var MESE="11"
how to calculate the first and last day of this date and assign a value in var FIRST_DAY and in var LAST_DAY
In this case:
FIRST_DAY="01/11/2010"
LAST_DAY="30/11/2010"
first and last days
-
- Administrator
- Posts: 78487
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: first and last days
Are FIRST_DAY and LAST_DAY string variables, as the quotes suggest, or are they date variables?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: first and last days
string var...HansV wrote:Are FIRST_DAY and LAST_DAY string variables, as the quotes suggest, or are they date variables?
-
- Administrator
- Posts: 78487
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: first and last days
Here you go:
FIRST_DAY = Format(DateSerial(ANNO, MESE, 1), "dd/mm/yyyy")
LAST_DAY = Format(DateSerial(ANNO, MESE + 1, 0), "dd/mm/yyyy")
FIRST_DAY = Format(DateSerial(ANNO, MESE, 1), "dd/mm/yyyy")
LAST_DAY = Format(DateSerial(ANNO, MESE + 1, 0), "dd/mm/yyyy")
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: first and last days
HansV wrote:Here you go:
FIRST_DAY = Format(DateSerial(ANNO, MESE, 1), "dd/mm/yyyy")
LAST_DAY = Format(DateSerial(ANNO, MESE + 1, 0), "dd/mm/yyyy")
sorry me for delay...
Work fine tks.