Re: Shortest possible one-liner to get number of days in a month
- From: "Lance Wynn" <LanceWynn@xxxxxxxxxxxxxxxx>
- Date: Sat, 4 Aug 2007 21:42:09 -0600
Yeah, I didn't test it, I just wrote it in the email. I basically just got
rid of the string manipulation, I should have used Date serial (as I believe
Mike did later in the email), and had I done it in the IDE, I would have
quickly realized my mistake. It is just such a simple thing to do in VB
that I didn't put the thought into it that I should have. Of course I was
on my way out to see Bourne Ultimatum, so my mind was even less on the task
at hand ;-) (pretty good show, except for the jumpy camera....)
Sorry it didn't work out for you.
Lance
"Kjell" <Kjell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:71E51AFC-702B-47F9-990B-A6B000691C58@xxxxxxxxxxxxxxxx
hmmmm, are you sure now....??
lets test it..
someDate = "2007-08-04"
q = Day(DateAdd("m", 1, someDate) - 1)
q is now 3
August has 31 days
sorry, but that's not what I was asking for
Kjell
"Lance Wynn" wrote:
q = Day(DateAdd("m", 1, somedate) - 1)
"Kjell" <Kjell@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:599F8675-4C4F-446B-B36A-2A3BED84C4B4@xxxxxxxxxxxxxxxx
This is something I need from time to time; The number of days for the
month
in X,
given that X Is a date variable of course.
X = SomeDate '(from the history or future)
Q = shortest One-liner to get total number of days in the month given
by X
This is my best so far
Q = Day(DateAdd("d", -1, CDate(Format(DateAdd("m", 1, X),
"yyyy-mm-01"))))
Kjell
.
- References:
- Re: Shortest possible one-liner to get number of days in a month
- From: Lance Wynn
- Re: Shortest possible one-liner to get number of days in a month
- Prev by Date: Re: help with command$ (registry parameters)
- Next by Date: Re: help with command$ (registry parameters)
- Previous by thread: Re: Shortest possible one-liner to get number of days in a month
- Next by thread: Re: Shortest possible one-liner to get number of days in a month
- Index(es):
Relevant Pages
|