Date Variable

R

Ranjith Kurian

Hi

I have one problem with the below code, it showing me the march 9th date,
how will i change it to 1st of every month, so that next month when i run
this it should show me 1st of April.

curmt = Format(Date, "mmm-yy")
curmth = CDbl(CDate(curmt))
MsgBox curmth

Answer is 39881, the required answer is 39873
 
F

Franz E

Hi, use this code instead:

curmt = Format(Date, "mmm-yyyy")
curmth = CDbl(CDate(curmt))
MsgBox curmth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top