View Single Post
  #1 (permalink)  
Old June 28th, 2010, 10:04 PM
WannaBeVb WannaBeVb is offline
Registered User
 
Join Date: Jun 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding months to get last day of month

I need to add months and get the last day of the month. Rigth now i pass a variable whihc is my last value in my gridview which is a date called lastdate
so I need to add to last date to find the last day of the next month to populate it with my datagrid. Here is some code but doe not work right what am I doing wrong.

Newdt = DateAdd(DateInterval.Month, (Day(DateAdd(DateInterval.Month, 1, lastdate))) * -1, DateAdd(DateInterval.Month, 1, Newdt))