Find the 1st day of a month / Last day of month

by MYLE 21. June 2010 21:23

I had to Find the Last day on the Month that the hard bit but got thinking why note just find the first day on the next month then -1 day form that so here it is

 

Function st1month(Tdate)
    st1month = DateSerial(Year(Tdate), Month(Tdate) + 1, 1)
End Function

OK now let find the Last day on month

Function LastDay(Tdate)
    Lastd = dateadd("m",1,st1month(Tdate))
    LastDay = DateAdd("d", -1, Lastd)
End Function

Must have both function in your code.

Dislexia

I see people have commented about my style of writting.
Well I have dislexia so spelling is not one of my good points
but when it comes to reading/written code thats the easy bit.

 

 

Poll

What Search Engine Do you use




Show Results

Disclaimer of Liability

While every effort will be made to ensure that the information contained within this website is accurate and up to date, The Company's listed with this web site and any associated parties, make no warranty, representation or undertaking, whether expressed or implied, nor does it assume any legal liability, whether direct or indirect, or responsibility for the accuracy, completeness, or usefulness of any information.

 

Google Ads

Most comments

carpet cleaning forest lake carpet cleaning forest lake
1 comments
us United States
carpet cleaning capalaba carpet cleaning capalaba
1 comments
us United States

RecentComments

Comment RSS