Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code for getting the next "the 1st in month"
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi all

I need a code snippet that saves the next 1st date in a month in a variable NewDate. In this case the value of NewDate would be 11012009

Anyone who has an idea ?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Try this...
Code:
Dim TmpDate, NewDate
   TmpDate = DateAdd("mm", 1, Date)
   NewDate = DateSerial(Year(TmpDate), Month(TmpDate), 1)
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Janriis,

Try with the below way.
Code:
Dim TmpDate1,TmpDate2
   TmpDate1 = DateAdd("m",1, Date)
   TmpDate2 = DateSerial(Year(TmpDate1),Month(TmpDate1),1)
   NewDate=replace(TmpDate2,"/","")
   Msgbox NewDate

Hope it helps you.Smile
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Exactly what i needed, thx. How do i insert the value of NewDate into my txtDate field ?
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Assuming date field is of class webedit.
You can have Browser().Page().webedit().set NewDate
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)